/*
 * Reels feed (<yoh-reels>, reels/assets/reels.js). Colors, font and radius come from the active skin's --ys-* tokens
 * (Market Makers: green primary, Space Grotesk, 20px corners); the fallbacks only apply with the Classic skin.
 * The video area stays black whatever the skin, like every short-video app.
 */
.ys-reels-root { --ys-reels-ink: #fff; --ys-reels-video: #000; --ys-reels-scrim: rgba(0, 0, 0, .55); margin: 0; }

.ys-reels {
	position: relative;
	height: calc(100vh - 80px);
	height: calc(100dvh - 80px);
	min-height: 420px;
	overflow: hidden;
	background: var(--ys-bg, #fff);
	color: var(--ys-text, #111827);
	font-family: var(--ys-font-body, inherit);
	-webkit-tap-highlight-color: transparent;
}
.ys-reels button { font-family: inherit; }
.ys-reels svg { width: 100%; height: 100%; fill: currentColor; display: block; }

.ys-reels__scroller {
	height: 100%;
	overflow-y: auto;
	overflow-x: hidden;
	scroll-snap-type: y mandatory;
	overscroll-behavior-y: contain;
	scrollbar-width: none;
	transition: padding-right .25s ease;
}
.ys-reels__scroller::-webkit-scrollbar { display: none; }

/* ------------------------------------------------------------------ one reel */
.ys-reel {
	height: 100%;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px 0;
	box-sizing: border-box;
}
.ys-reel__stage { position: relative; display: flex; align-items: flex-end; gap: 16px; height: 100%; }
.ys-reel__card {
	position: relative;
	height: 100%;
	aspect-ratio: 9 / 16;
	max-width: calc(100vw - 110px);
	border-radius: var(--ys-radius, 16px);
	overflow: hidden;
	background: var(--ys-reels-video);
	cursor: pointer;
	user-select: none;
	box-shadow: var(--ys-shadow, 0 10px 30px rgba(0, 0, 0, .12));
}
.ys-reel__poster {
	position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
	filter: blur(22px) brightness(.7); transform: scale(1.15);
}
.ys-reel__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.ys-reel__shade {
	position: absolute; inset: auto 0 0 0; height: 45%; pointer-events: none;
	background: linear-gradient(to top, var(--ys-reels-scrim), transparent);
}

.ys-reel__meta {
	position: absolute; left: 16px; right: 16px; bottom: 20px; z-index: 2;
	color: var(--ys-reels-ink); text-shadow: 0 1px 2px rgba(0, 0, 0, .45); cursor: default;
}
.ys-reel__handle { color: var(--ys-reels-ink) !important; font-weight: 700; font-size: 1.05em; text-decoration: none; }
.ys-reel__handle:hover { text-decoration: underline; }
.ys-reel__date { color: var(--ys-reels-ink); opacity: .8; font-size: .9em; }
.ys-reel__caption {
	margin: 6px 0 0; line-height: 1.4; white-space: pre-line; word-break: break-word; color: var(--ys-reels-ink) !important; font-size: .95em;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ys-reel__caption.open { display: block; max-height: 9.5em; overflow-y: auto; }
.ys-reel__more {
	background: none; border: 0; padding: 0; margin: 2px 0 0; color: var(--ys-reels-ink); font-weight: 700; cursor: pointer;
}
.ys-reel__sound { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .9em; max-width: 75%; }
.ys-reel__sound > span:first-child { width: 14px; height: 14px; flex: none; }
.ys-reel__marquee { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; }

.ys-reel__progress {
	position: absolute; left: 0; right: 0; bottom: 0; height: 14px; z-index: 3; cursor: pointer;
	display: flex; align-items: flex-end;
}
.ys-reel__progress::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .25); }
.ys-reel__progress span { position: relative; height: 3px; background: var(--ys-reels-ink); transition: height .15s; }
.ys-reel__progress:hover::before, .ys-reel__progress:hover span { height: 6px; }

.ys-reel__play {
	position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; z-index: 2;
	color: var(--ys-reels-ink); opacity: .85; pointer-events: none; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .4));
	animation: ys-pop .2s ease-out;
}
.ys-reel__spin, .ys-sheet__state .ys-reel__spin {
	position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px;
	border: 3px solid rgba(255, 255, 255, .3); border-top-color: var(--ys-reels-ink); border-radius: 50%;
	animation: ys-spin .8s linear infinite; z-index: 2;
}
.ys-reel--state .ys-reel__spin, .ys-sheet__state .ys-reel__spin { position: static; margin: 0 auto; display: block; border-color: var(--ys-border, #e5e7eb); border-top-color: var(--ys-primary, #15803d); }
.ys-reel__unmute {
	position: absolute; left: 14px; top: 64px; z-index: 3; display: inline-flex; align-items: center; gap: 6px;
	padding: 7px 12px; border: 0; border-radius: 999px; background: var(--ys-reels-scrim); color: var(--ys-reels-ink);
	font-weight: 600; font-size: .85em; cursor: pointer; backdrop-filter: blur(6px);
}
.ys-reel__unmute span { width: 16px; height: 16px; }
.ys-reel__burst {
	position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; z-index: 4; pointer-events: none;
	color: var(--ys-danger, #dc2626); filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .3));
	animation: ys-burst .9s ease-out forwards;
}

/* ------------------------------------------------------------------ action rail */
.ys-reel__rail { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-bottom: 6px; }
.ys-reel__avatar { position: relative; margin-bottom: 10px; }
.ys-reel__avatar img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; display: block; border: 2px solid var(--ys-surface, #fff); }
.ys-reel__follow {
	position: absolute; left: 50%; bottom: -10px; width: 22px; height: 22px; margin-left: -11px; padding: 3px;
	border: 0; border-radius: 50%; background: var(--ys-primary, #15803d); color: var(--ys-primary-contrast, #fff);
	cursor: pointer; transition: transform .15s;
}
.ys-reel__follow:hover { transform: scale(1.12); }
.ys-reel__follow.on { background: var(--ys-surface, #fff); color: var(--ys-primary, #15803d); }
.ys-reel__act {
	display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: none;
	color: var(--ys-text, #111827); cursor: pointer;
}
.ys-reel__ico {
	width: 48px; height: 48px; padding: 12px; box-sizing: border-box; border-radius: 50%;
	background: var(--ys-surface-alt, #f3f4f6); transition: transform .15s, background .15s;
}
.ys-reel__act:hover .ys-reel__ico { background: var(--ys-border, #e5e7eb); }
.ys-reel__act:active .ys-reel__ico { transform: scale(.88); }
.ys-reel__act b { font-size: .8em; font-weight: 700; color: var(--ys-text, #111827); }
.ys-reel__act--like.on .ys-reel__ico { color: var(--ys-danger, #dc2626); animation: ys-pop .3s ease-out; }
.ys-reel__act--save.on .ys-reel__ico { color: var(--ys-warning, #b45309); animation: ys-pop .3s ease-out; }
.ys-reel__act--small .ys-reel__ico { width: 40px; height: 40px; padding: 10px; }
.ys-reel__disc {
	width: 42px; height: 42px; border-radius: 50%; padding: 9px; box-sizing: border-box; margin-top: 2px;
	background: radial-gradient(circle, #333 0 30%, #111 31% 100%);
}
.ys-reel__disc img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.ys-reel.is-active .ys-reel__disc { animation: ys-spin 5s linear infinite; }

/* ------------------------------------------------------------------ overlays: tabs, tools, nav */
.ys-reels__tabs {
	position: absolute; top: 26px; left: 50%; transform: translateX(-50%); z-index: 6;
	display: flex; gap: 2px; padding: 4px; border-radius: 999px;
	background: var(--ys-reels-scrim); backdrop-filter: blur(8px);
}
.ys-reels__tabs button {
	border: 0; background: none; color: rgba(255, 255, 255, .75); font-weight: 600; font-size: .92em;
	padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.ys-reels__tabs button.on { background: var(--ys-reels-ink); color: var(--ys-reels-video); }
.ys-reels__tools { position: absolute; top: 18px; right: 18px; z-index: 6; display: flex; gap: 10px; }
.ys-reels__tool {
	width: 42px; height: 42px; padding: 10px; border: 1px solid var(--ys-border, #e5e7eb); border-radius: 50%;
	background: var(--ys-surface, #fff); color: var(--ys-text, #111827); cursor: pointer;
}
.ys-reels__tool--add { background: var(--ys-primary, #15803d); border-color: var(--ys-primary, #15803d); color: var(--ys-primary-contrast, #fff); }
.ys-reels__nav { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column; gap: 12px; }
.ys-reels__nav button {
	width: 46px; height: 46px; padding: 11px; border: 0; border-radius: 50%; cursor: pointer;
	background: var(--ys-surface-alt, #f3f4f6); color: var(--ys-text, #111827);
}
.ys-reels__nav button:hover:not(:disabled) { background: var(--ys-border, #e5e7eb); }
.ys-reels__nav button:disabled { opacity: .35; cursor: default; }

/* ------------------------------------------------------------------ empty / end */
.ys-reel--state, .ys-reel--end { padding: 24px; }
.ys-reels__empty {
	max-width: 360px; text-align: center; padding: 32px 28px; border-radius: var(--ys-radius, 16px);
	background: var(--ys-surface, #fff); border: 1px solid var(--ys-border, #e5e7eb);
}
.ys-reels__empty h3 { margin: 0 0 8px; font-family: var(--ys-font-heading, inherit); font-size: 1.25em; color: var(--ys-text, #111827); }
.ys-reels__empty p { margin: 0 0 18px; color: var(--ys-muted, #6b7280); }
.ys-reels__btn {
	display: inline-block; border: 0; border-radius: 999px; padding: 11px 22px; font-weight: 700; cursor: pointer;
	background: var(--ys-primary, #15803d); color: var(--ys-primary-contrast, #fff);
}
.ys-reels__btn:disabled { opacity: .5; cursor: default; }

/* ------------------------------------------------------------------ sheets */
.ys-reels__backdrop { position: absolute; inset: 0; z-index: 20; background: rgba(0, 0, 0, .35); animation: ys-fade .2s; }
.ys-sheet {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 30; max-height: 72%;
	display: flex; flex-direction: column; background: var(--ys-surface, #fff); color: var(--ys-text, #111827);
	border-radius: var(--ys-radius, 16px) var(--ys-radius, 16px) 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
	animation: ys-up .25s ease-out;
}
.ys-sheet__head { display: flex; align-items: center; justify-content: center; position: relative; padding: 16px 48px 12px; border-bottom: 1px solid var(--ys-border, #e5e7eb); }
.ys-sheet__head h4 { margin: 0; font-size: 1em; font-weight: 700; font-family: var(--ys-font-heading, inherit); }
.ys-sheet__x {
	position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; padding: 7px;
	border: 0; border-radius: 50%; background: var(--ys-surface-alt, #f3f4f6); color: var(--ys-text, #111827); cursor: pointer;
}
.ys-sheet__body { flex: 1; overflow-y: auto; padding: 6px 16px; min-height: 180px; }
.ys-sheet__state { text-align: center; color: var(--ys-muted, #6b7280); padding: 40px 0; margin: 0; }

.ys-comments { list-style: none; margin: 0; padding: 0; }
.ys-comment { display: flex; gap: 12px; padding: 12px 0; }
.ys-comment__avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.ys-comment__main { flex: 1; min-width: 0; }
.ys-comment__name { font-weight: 600; font-size: .88em; color: var(--ys-muted, #6b7280) !important; text-decoration: none; }
.ys-comment__badge {
	margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: .8em;
	background: var(--ys-primary, #15803d); color: var(--ys-primary-contrast, #fff);
}
.ys-comment__text { margin: 3px 0 4px; line-height: 1.4; word-break: break-word; white-space: pre-line; }
.ys-comment__date { font-size: .8em; color: var(--ys-muted, #6b7280); }
.ys-comment__like {
	display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; padding: 4px;
	color: var(--ys-muted, #6b7280); cursor: pointer;
}
.ys-comment__like span { width: 18px; height: 18px; }
.ys-comment__like b { font-size: .75em; font-weight: 600; }
.ys-comment__like.on { color: var(--ys-danger, #dc2626); }
.ys-sheet__compose { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--ys-border, #e5e7eb); }
.ys-sheet__compose img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.ys-sheet__compose input {
	flex: 1; min-width: 0; border: 1px solid var(--ys-border, #e5e7eb); border-radius: 999px; padding: 10px 16px;
	background: var(--ys-surface-alt, #f3f4f6); color: var(--ys-text, #111827); font: inherit; outline: none;
}
.ys-sheet__compose input:focus { border-color: var(--ys-primary, #15803d); }
.ys-sheet__compose button { border: 0; background: none; color: var(--ys-primary, #15803d); font-weight: 700; cursor: pointer; padding: 6px; }
.ys-sheet__compose button:disabled { color: var(--ys-muted, #6b7280); opacity: .6; cursor: default; }

.ys-share { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 14px 6px; padding: 18px 16px 24px; }
.ys-share__item {
	display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; padding: 0;
	color: var(--ys-text, #111827) !important; text-decoration: none; font-size: .82em; cursor: pointer;
}
.ys-share__ico {
	width: 50px; height: 50px; padding: 13px; box-sizing: border-box; border-radius: 50%;
	background: var(--ys-surface-alt, #f3f4f6); color: var(--ys-text, #111827);
}
.ys-share__ico--txt { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.25em; padding: 0; }
.ys-share__item:hover .ys-share__ico { background: var(--ys-border, #e5e7eb); }

.ys-options { display: flex; flex-direction: column; padding: 8px 0 14px; }
.ys-options button {
	display: flex; align-items: center; gap: 14px; padding: 13px 20px; border: 0; background: none;
	color: var(--ys-text, #111827); font-weight: 600; text-align: left; cursor: pointer;
}
.ys-options button:hover { background: var(--ys-row-hover, #f9fafb); }
.ys-options span { width: 22px; height: 22px; }

.ys-upload { display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow-y: auto; }
.ys-upload__drop {
	position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
	min-height: 180px; border: 2px dashed var(--ys-border, #e5e7eb); border-radius: var(--ys-radius, 16px);
	color: var(--ys-muted, #6b7280); cursor: pointer; overflow: hidden; padding: 16px;
}
.ys-upload__drop b { color: var(--ys-primary, #15803d); }
.ys-upload__drop.has { padding: 0; border-style: solid; background: var(--ys-reels-video); }
.ys-upload__drop video { max-height: 260px; width: 100%; object-fit: contain; display: block; }
.ys-upload__drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ys-upload textarea {
	border: 1px solid var(--ys-border, #e5e7eb); border-radius: 12px; padding: 10px 12px; font: inherit; resize: vertical;
	background: var(--ys-surface-alt, #f3f4f6); color: var(--ys-text, #111827);
}
.ys-upload__error { margin: 0; color: var(--ys-danger, #dc2626); font-size: .9em; }

.ys-reels__toast {
	position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 40; max-width: calc(100% - 32px);
	padding: 11px 18px; border-radius: 999px; background: rgba(17, 24, 39, .92); color: var(--ys-reels-ink);
	font-weight: 600; font-size: .92em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ys-reels__toast a { color: var(--ys-accent, #22c55e) !important; margin-left: 6px; }
.ys-fade-enter-active, .ys-fade-leave-active { transition: opacity .2s, transform .2s; }
.ys-fade-enter, .ys-fade-leave-to { opacity: 0; transform: translate(-50%, 8px); }

/* ------------------------------------------------------------------ desktop: comments as a side panel */
@media (min-width: 900px) {
	.ys-reels.has-panel .ys-reels__scroller { padding-right: 400px; }
	.ys-reels.has-panel .ys-reels__nav { right: 422px; }
	.ys-reels.has-panel .ys-reels__backdrop { background: transparent; right: 400px; }
	.ys-sheet--comments {
		top: 0; left: auto; width: 400px; max-height: none; border-radius: 0;
		border-left: 1px solid var(--ys-border, #e5e7eb); box-shadow: none; animation: ys-left .25s ease-out;
	}
	.ys-sheet--share, .ys-sheet--more, .ys-sheet--upload {
		left: 50%; bottom: auto; top: 50%; width: 440px; max-height: 86%;
		transform: translate(-50%, -50%); border-radius: var(--ys-radius, 16px); animation: ys-fade .2s;
	}
}

/* ------------------------------------------------------------------ phones: full-bleed, rail on the video */
@media (max-width: 640px) {
	.ys-reel { padding: 0; }
	.ys-reel__stage { width: 100%; }
	.ys-reel__card { width: 100%; max-width: none; aspect-ratio: auto; border-radius: 14px; box-shadow: none; }
	.ys-reel__meta { right: 78px; bottom: 22px; }
	.ys-reel__rail { position: absolute; right: 8px; bottom: 22px; z-index: 5; gap: 12px; }
	.ys-reel__act, .ys-reel__act b { color: var(--ys-reels-ink); }
	.ys-reel__act b { text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
	.ys-reel__ico { background: none; padding: 7px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5)); }
	.ys-reel__act:hover .ys-reel__ico { background: none; }
	.ys-reels__nav { display: none; }
	.ys-reels__tabs { top: 12px; }
	.ys-reels__tabs button { padding: 6px 11px; font-size: .86em; }
	.ys-reels__tools { top: 58px; right: 10px; flex-direction: column; }
	.ys-reels__tool { background: var(--ys-reels-scrim); border-color: transparent; color: var(--ys-reels-ink); width: 38px; height: 38px; padding: 9px; }
	.ys-reels__tool--add { background: var(--ys-primary, #15803d); }
	.ys-reel__unmute { top: 60px; }
}

@media (prefers-reduced-motion: reduce) {
	.ys-reel.is-active .ys-reel__disc { animation: none; }
}

@keyframes ys-spin { to { transform: rotate(360deg); } }
@keyframes ys-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes ys-burst {
	0% { opacity: 0; transform: scale(.3) rotate(var(--r, 0deg)); }
	15% { opacity: 1; transform: scale(1.2) rotate(var(--r, 0deg)); }
	30% { transform: scale(.95) rotate(var(--r, 0deg)); }
	70% { opacity: 1; transform: scale(1) rotate(var(--r, 0deg)) translateY(0); }
	100% { opacity: 0; transform: scale(1.3) rotate(var(--r, 0deg)) translateY(-60px); }
}
@keyframes ys-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes ys-left { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes ys-fade { from { opacity: 0; } to { opacity: 1; } }
.ys-comment.is-pending { opacity: .55; }

/* ------------------------------------------------------------------ creator profile: header, reels grid, shop */
.ys-profile {
	position: absolute; inset: 0; z-index: 15; overflow-y: auto; overscroll-behavior: contain;
	background: var(--ys-bg, #fff); color: var(--ys-text, #111827);
}
.ys-profile__bar {
	position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 12px 16px;
	background: var(--ys-bg, #fff); border-bottom: 1px solid var(--ys-border, #e5e7eb);
}
.ys-profile__bar h3 { flex: 1; margin: 0; text-align: center; font-size: 1.05em; font-weight: 700; font-family: var(--ys-font-heading, inherit); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ys-profile__icon {
	position: relative; flex: none; width: 40px; height: 40px; padding: 9px; border: 0; border-radius: 50%; cursor: pointer;
	background: var(--ys-surface-alt, #f3f4f6); color: var(--ys-text, #111827) !important; box-sizing: border-box;
}
.ys-profile__icon span { display: block; width: 100%; height: 100%; }
.ys-profile__cart b {
	position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
	border-radius: 999px; font-size: 11px; line-height: 18px; text-align: center;
	background: var(--ys-primary, #15803d); color: var(--ys-primary-contrast, #fff);
}
.ys-profile__body { max-width: 760px; margin: 0 auto; padding: 22px 16px 40px; }
.ys-profile__head { display: flex; align-items: center; gap: 18px; }
.ys-profile__avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none; border: 3px solid var(--ys-surface, #fff); box-shadow: 0 0 0 2px var(--ys-primary, #15803d); }
.ys-profile__who h2 { margin: 0; font-size: 1.5em; font-family: var(--ys-font-heading, inherit); color: var(--ys-text, #111827); }
.ys-profile__who span { color: var(--ys-muted, #6b7280); }
.ys-profile__stats { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; margin: 20px 0 16px; padding: 0; text-align: center; }
.ys-profile__stats li { color: var(--ys-muted, #6b7280); font-size: .85em; }
.ys-profile__stats b { display: block; font-size: 1.35em; color: var(--ys-text, #111827); }
.ys-profile__actions { display: flex; gap: 10px; }
.ys-profile__actions .ys-reels__btn { flex: 1; }
.ys-reels__btn.is-ghost { background: var(--ys-surface-alt, #f3f4f6); color: var(--ys-text, #111827) !important; text-align: center; text-decoration: none; }
.ys-profile__bio { margin: 14px 0 0; white-space: pre-line; line-height: 1.45; }
.ys-profile__tabs { display: flex; margin: 22px -16px 2px; border-bottom: 1px solid var(--ys-border, #e5e7eb); }
.ys-profile__tabs button {
	flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 0; background: none;
	color: var(--ys-muted, #6b7280); font-weight: 700; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.ys-profile__tabs button span { width: 18px; height: 18px; }
.ys-profile__tabs button em { font-style: normal; font-size: .8em; padding: 1px 7px; border-radius: 999px; background: var(--ys-surface-alt, #f3f4f6); }
.ys-profile__tabs button.on { color: var(--ys-text, #111827); border-bottom-color: var(--ys-text, #111827); }
.ys-profile__more { display: block; margin: 16px auto 0; }

.ys-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 3px -16px 0; }
.ys-grid__item { position: relative; aspect-ratio: 9 / 16; padding: 0; border: 0; overflow: hidden; cursor: pointer; background: var(--ys-reels-video); }
.ys-grid__item img, .ys-grid__item video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.ys-grid__item:hover img, .ys-grid__item:hover video { transform: scale(1.04); }
.ys-grid__views {
	position: absolute; left: 8px; bottom: 6px; display: flex; align-items: center; gap: 4px;
	color: var(--ys-reels-ink); font-weight: 700; font-size: .85em; text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.ys-grid__views i { width: 14px; height: 14px; display: block; }

.ys-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-top: 16px; }
.ys-shop__item {
	display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--ys-radius, 16px);
	background: var(--ys-surface, #fff); border: 1px solid var(--ys-border, #e5e7eb);
}
.ys-shop__img { position: relative; display: block; aspect-ratio: 1; border-radius: calc(var(--ys-radius, 16px) - 6px); overflow: hidden; background: var(--ys-surface-alt, #f3f4f6); }
.ys-shop__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ys-shop__tag {
	position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; font-size: .75em; font-weight: 700;
	background: var(--ys-danger, #dc2626); color: var(--ys-on-color, #fff);
}
.ys-shop__title {
	color: var(--ys-text, #111827) !important; font-weight: 600; text-decoration: none; line-height: 1.3;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em;
}
.ys-shop__price { color: var(--ys-primary, #15803d); font-weight: 700; }
.ys-shop__add { margin-top: auto; padding: 9px 12px; font-size: .9em; text-align: center; text-decoration: none; }

.ys-reels__back {
	position: absolute; top: 22px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 8px;
	padding: 5px 14px 5px 6px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 700;
	background: var(--ys-reels-scrim); color: var(--ys-reels-ink); backdrop-filter: blur(8px);
}
.ys-reels__back span { width: 20px; height: 20px; }
.ys-reels__back img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.ys-comment__avatar { cursor: pointer; }

@media (max-width: 640px) {
	.ys-profile__avatar { width: 76px; height: 76px; }
	.ys-profile__who h2 { font-size: 1.25em; }
	.ys-shop { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.ys-reels__back { top: 12px; }
}
/* The theme rounds every button; the grid tiles and the profile tabs are square. */
.ys-profile .ys-grid__item { border-radius: 4px; }
.ys-profile .ys-profile__tabs button { border-radius: 0; box-shadow: none; }

/* ------------------------------------------------------------------ screen changes without page loads */
.ys-slide-enter-active, .ys-slide-leave-active { transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .28s; }
.ys-slide-enter, .ys-slide-leave-to { transform: translateX(100%); opacity: .6; }
.ys-reels__scroller.ys-swap-in { animation: ys-swap-in .32s cubic-bezier(.2, .8, .2, 1); }
.ys-reels__scroller.ys-swap-back { animation: ys-swap-back .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes ys-swap-in { from { transform: translateX(40%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ys-swap-back { from { transform: translateX(-40%); opacity: 0; } to { transform: none; opacity: 1; } }
.ys-profile__body.is-loading .ys-profile__stats b { color: var(--ys-muted, #6b7280); }

/* product quick view (opens over the shop tab, the feed stays where it was) */
.ys-sheet--product { max-height: 88%; }
.ys-product { overflow-y: auto; flex: 1; }
.ys-product__gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--ys-surface-alt, #f3f4f6); }
.ys-product__gallery::-webkit-scrollbar { display: none; }
.ys-product__gallery img { flex: 0 0 100%; width: 100%; max-height: 340px; object-fit: contain; scroll-snap-align: start; }
.ys-product__info { padding: 14px 16px 8px; }
.ys-product__info .ys-shop__price { font-size: 1.3em; }
.ys-product__stock { margin-left: 10px; color: var(--ys-muted, #6b7280); font-size: .9em; }
.ys-product__text { margin-top: 10px; line-height: 1.5; color: var(--ys-text, #111827); }
.ys-product__text p { margin: 0 0 8px; color: inherit !important; }
.ys-product__buy { display: flex; gap: 10px; padding: 12px 16px 16px; border-top: 1px solid var(--ys-border, #e5e7eb); }
.ys-product__buy > * { flex: 1; text-align: center; text-decoration: none; }
.ys-reels__btn.is-off { opacity: .7; cursor: default; font-weight: 600; }
@media (min-width: 900px) { .ys-sheet--product { width: 480px; left: 50%; bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: var(--ys-radius, 16px); animation: ys-fade .2s; } }
@media (prefers-reduced-motion: reduce) {
	.ys-slide-enter-active, .ys-slide-leave-active { transition: none; }
	.ys-reels__scroller.ys-swap-in, .ys-reels__scroller.ys-swap-back { animation: none; }
}

/* ------------------------------------------------------------------ top menu: centred on the video, never past it */
.ys-reels__tabs { top: 24px; gap: 0; padding: 3px; max-width: calc(100% - 32px); }
.ys-reels__tabs button { padding: 6px 12px; font-size: .86em; }
@media (min-width: 641px) {
	/* The rail sits right of the video: pad the left by as much so the video itself is centred under the menu. */
	.ys-reel__stage { padding-left: 66px; }
}
@media (min-width: 1100px) {
	/* Wide screens: the menu and the creator pill sit top-left, off the video (as TikTok does on the web). */
	.ys-reels__tabs, .ys-reels__back { left: 22px; top: 18px; transform: none; }
	.ys-reels__tabs { background: var(--ys-surface-alt, #f3f4f6); backdrop-filter: none; }
	.ys-reels__tabs button { color: var(--ys-muted, #6b7280); }
	.ys-reels__tabs button.on { background: var(--ys-primary, #15803d); color: var(--ys-primary-contrast, #fff); }
	.ys-reel__unmute { top: 16px; }
}

/* ------------------------------------------------------------------ link reels: the platform player, our band under it */
.ys-reel__card.is-embed { display: flex; flex-direction: column; cursor: default; }
.ys-reel__frame { position: relative; flex: 1; min-height: 0; background: var(--ys-reels-video); overflow: hidden; }
.ys-reel__poster--sharp { filter: none; transform: none; object-fit: cover; opacity: .55; }
.ys-reel__frame-label {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	color: rgba(255, 255, 255, .5); font-weight: 700; font-size: 1.4em; letter-spacing: .02em;
}
.ys-reel__iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--ys-reels-video); }
/* Instagram and Facebook draw their own header and buttons: they keep the whole frame, nothing of ours on top. */
.ys-reel__meta.is-band {
	position: static; flex: none; padding: 10px 14px 12px; background: var(--ys-reels-video);
	text-shadow: none; max-height: 34%; overflow-y: auto;
}
.ys-reel__meta.is-band .ys-reel__caption { -webkit-line-clamp: 1; }
.ys-reel__meta.is-band .ys-reel__caption.open { -webkit-line-clamp: unset; }
.ys-reel__via { padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-weight: 700; font-size: .85em; }
.ys-reel__meta a.ys-reel__marquee { color: var(--ys-reels-ink) !important; opacity: .8; text-decoration: underline; }
.ys-reel__spin--inline { position: static; display: inline-block; width: 14px; height: 14px; margin: 0 6px -2px 0; border-width: 2px; border-color: var(--ys-border, #e5e7eb); border-top-color: var(--ys-primary, #15803d); }

/* ------------------------------------------------------------------ the reel token */
.ys-reel__token { margin-bottom: 8px; }
.ys-token {
	display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 8px; border: 0; border-radius: 999px;
	background: rgba(255, 255, 255, .18); color: var(--ys-reels-ink) !important; font-weight: 700; font-size: .88em;
	text-decoration: none; text-shadow: none; cursor: pointer; backdrop-filter: blur(6px);
}
.ys-token > span { width: 16px; height: 16px; }
.ys-token b { padding: 3px 10px; border-radius: 999px; background: var(--ys-primary, #15803d); color: var(--ys-primary-contrast, #fff); font-size: .92em; }
.ys-token.is-live b { background: var(--ys-accent, #22c55e); }
.ys-token.is-soon { cursor: default; }
.ys-token.is-soon b { background: rgba(255, 255, 255, .22); font-weight: 600; }

/* ------------------------------------------------------------------ post screen */
.ys-compose {
	position: absolute; inset: 0; z-index: 16; overflow-y: auto; overscroll-behavior: contain;
	background: var(--ys-bg, #fff); color: var(--ys-text, #111827);
}
.ys-compose__spacer { width: 40px; flex: none; }
.ys-compose__body { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 28px; max-width: 980px; margin: 0 auto; padding: 22px 20px 40px; }
.ys-compose__source { display: flex; padding: 4px; margin-bottom: 12px; border-radius: 999px; background: var(--ys-surface-alt, #f3f4f6); }
.ys-compose__source button {
	flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; border: 0;
	border-radius: 999px; background: none; color: var(--ys-muted, #6b7280); font-weight: 700; cursor: pointer;
}
.ys-compose__source button span { width: 18px; height: 18px; }
.ys-compose__source button.on { background: var(--ys-surface, #fff); color: var(--ys-text, #111827); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.ys-compose__drop {
	position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 9 / 16; max-height: 60vh;
	border: 2px dashed var(--ys-border, #e5e7eb); border-radius: var(--ys-radius, 16px); overflow: hidden; cursor: pointer;
	background: var(--ys-surface-alt, #f3f4f6); text-align: center;
}
.ys-compose__drop.has { border-style: solid; background: var(--ys-reels-video); }
.ys-compose__drop video { width: 100%; height: 100%; object-fit: contain; }
.ys-compose__drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ys-compose__hint { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px; color: var(--ys-muted, #6b7280); font-size: .9em; }
.ys-compose__hint b { color: var(--ys-text, #111827); font-size: 1.1em; }
.ys-compose__big { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: var(--ys-primary, #15803d); color: var(--ys-primary-contrast, #fff); box-sizing: border-box; }
.ys-compose__note { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; color: var(--ys-muted, #6b7280); font-size: .85em; line-height: 1.4; }
.ys-compose__note img { width: 36px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; }
.ys-compose__link input, .ys-field input, .ys-field select, .ys-field textarea {
	width: 100%; box-sizing: border-box; padding: 11px 14px; border: 1px solid var(--ys-border, #e5e7eb); border-radius: 12px;
	background: var(--ys-surface, #fff); color: var(--ys-text, #111827); font: inherit; outline: none;
}
.ys-compose__link input:focus, .ys-field input:focus, .ys-field select:focus, .ys-field textarea:focus { border-color: var(--ys-primary, #15803d); }
.ys-compose__embed { position: relative; margin-top: 12px; aspect-ratio: 9 / 16; max-height: 60vh; border-radius: var(--ys-radius, 16px); overflow: hidden; background: var(--ys-reels-video); }
.ys-compose__embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ys-compose__badge { position: absolute; top: 10px; left: 10px; z-index: 1; padding: 3px 10px; border-radius: 999px; background: var(--ys-reels-scrim); color: var(--ys-reels-ink); font-weight: 700; font-size: .8em; pointer-events: none; }
.ys-compose__fields { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ys-field { position: relative; display: flex; flex-direction: column; gap: 6px; }
.ys-field > span { font-weight: 700; font-size: .9em; }
.ys-field > em { position: absolute; right: 10px; bottom: 8px; font-style: normal; font-size: .75em; color: var(--ys-muted, #6b7280); }
.ys-field textarea { resize: vertical; }
.ys-field > i { position: absolute; left: 13px; bottom: 11px; font-style: normal; color: var(--ys-muted, #6b7280); font-weight: 700; }
.ys-field--symbol input, .ys-field--price input { padding-left: 26px; text-transform: uppercase; }
.ys-field--price { max-width: 200px; }
.ys-compose__token {
	margin: 0; padding: 16px; border: 1px solid var(--ys-border, #e5e7eb); border-radius: var(--ys-radius, 16px);
	background: var(--ys-surface, #fff); display: flex; flex-direction: column; gap: 12px;
}
.ys-compose__token legend { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-weight: 700; font-family: var(--ys-font-heading, inherit); }
.ys-compose__token legend span { width: 20px; height: 20px; color: var(--ys-primary, #15803d); }
.ys-compose__token p { margin: 0; color: var(--ys-muted, #6b7280); font-size: .88em; line-height: 1.45; }
.ys-compose__row { display: grid; grid-template-columns: 1fr 150px; gap: 12px; }
.ys-check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.ys-check input { width: 18px; height: 18px; accent-color: var(--ys-primary, #15803d); }
.ys-compose__progress { height: 6px; border-radius: 999px; background: var(--ys-surface-alt, #f3f4f6); overflow: hidden; }
.ys-compose__progress span { display: block; height: 100%; background: var(--ys-primary, #15803d); transition: width .2s; }
.ys-compose__post { padding: 14px 22px; font-size: 1.02em; }
.ys-compose__done { max-width: 460px; margin: 0 auto; padding: 48px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ys-compose__done h2 { margin: 0; font-family: var(--ys-font-heading, inherit); }
.ys-compose__check { width: 64px; height: 64px; padding: 14px; box-sizing: border-box; border-radius: 50%; background: var(--ys-primary, #15803d); color: var(--ys-primary-contrast, #fff); }
.ys-compose__minted { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px; border-radius: var(--ys-radius, 16px); background: var(--ys-surface-alt, #f3f4f6); }
.ys-compose__minted p { margin: 0; color: var(--ys-text, #111827); line-height: 1.45; }
.ys-compose__minted .ys-token { background: var(--ys-text, #111827); }
.ys-rise-enter-active, .ys-rise-leave-active { transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .3s; }
.ys-rise-enter, .ys-rise-leave-to { transform: translateY(40px); opacity: 0; }

@media (max-width: 760px) {
	.ys-compose__body { grid-template-columns: 1fr; padding: 16px 14px 32px; gap: 18px; }
	.ys-compose__drop, .ys-compose__embed { max-height: 46vh; margin: 0 auto; }
}
@media (max-width: 640px) {
	/* Phones: our side buttons stay over the player, but only the buttons take taps; the rest reaches the player. */
	.ys-reel__rail { pointer-events: none; }
	.ys-reel__rail > * { pointer-events: auto; }
	.ys-reel__card.is-embed ~ .ys-reel__rail { bottom: 114px; }
	.ys-reels__tabs { top: 10px; }
	.ys-reel__card.is-embed .ys-reel__frame { margin-top: 46px; }
}

/* link reels: a slim band, the player keeps most of the height */
.ys-reel__meta.is-band { max-height: 30%; padding: 8px 12px 10px; font-size: .92em; }
.ys-reel__meta.is-band .ys-reel__token { margin-bottom: 4px; }
.ys-reel__meta.is-band .ys-reel__caption { margin-top: 2px; }
.ys-reel__source { margin-top: 4px; font-size: .85em; }
.ys-reel__source a { color: var(--ys-reels-ink) !important; opacity: .75; }
@media (max-width: 1099px) {
	/* The menu sits over the top of the video here: link reels leave that strip to it, so the player header stays visible. */
	.ys-reel__card.is-embed .ys-reel__frame { margin-top: 46px; }
}
@media (max-height: 720px) {
	/* Short windows: a tighter rail so every button fits beside the video. */
	.ys-reel__rail { gap: 8px; }
	.ys-reel__ico { width: 40px; height: 40px; padding: 10px; }
	.ys-reel__avatar img { width: 42px; height: 42px; }
	.ys-reel__disc { display: none; }
}
@media (max-width: 640px) {
	/* Link reels on phones: the player keeps all of its own buttons; ours become a row in the band under it. */
	.ys-reel__card.is-embed .ys-reel__meta.is-band { padding-bottom: 52px; max-height: 38%; }
	.ys-reel__card.is-embed ~ .ys-reel__rail {
		left: 6px; right: 6px; bottom: 6px; flex-direction: row; justify-content: space-around; align-items: center; gap: 0;
	}
	.ys-reel__card.is-embed ~ .ys-reel__rail .ys-reel__avatar,
	.ys-reel__card.is-embed ~ .ys-reel__rail .ys-reel__disc { display: none; }
	.ys-reel__card.is-embed ~ .ys-reel__rail .ys-reel__act { flex-direction: row; gap: 2px; }
	.ys-reel__card.is-embed ~ .ys-reel__rail .ys-reel__ico { width: 36px; height: 36px; padding: 8px; filter: none; }
}
@media (max-width: 640px) {
	/* Phones: + sits in the menu row, off the video; sound is the "Tap for sound" chip and the ... menu. */
	.ys-reels__tools { top: 10px; right: 8px; flex-direction: row; }
	.ys-reels__tools .ys-reels__tool:not(.ys-reels__tool--add) { display: none; }
	.ys-reels__tools .ys-reels__tool--add { width: 34px; height: 34px; padding: 8px; }
	.ys-reels__tabs { left: calc(50% - 20px); }
}
