@font-face {
  font-family: "NguTube Thai";
  src: url("assets/thai-regular.woff2") format("woff2");
  font-weight: 400 550;
  font-display: swap;
}
@font-face {
  font-family: "NguTube Thai";
  src: url("assets/thai-bold.woff2") format("woff2");
  font-weight: 600 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #050b1c;
  --bar: #060d22;
  --side: #07102a;
  --surface: #0b1738;
  --raised: #102048;
  --hover: #16295c;
  --line: #172a54;
  --text: #eaf1ff;
  --sub: #b3c3e6;
  --muted: #8497c0;
  --accent: #52c7ff;
  --accent-ink: #031328;
  --active: #0f2a5e;
  --active-line: #1f4fa6;
  --violet: #8aa9ff;
  --green: #5fe0b8;
  --blue: #6db4ff;
  --amber: #f0be85;
  --glow: 82,199,255;
  --ease: cubic-bezier(.22,.8,.24,1);
  --rail: 218px;
  --header: 72px;
  --gutter: clamp(22px, 2.55vw, 44px);
  font-family: "NguTube Thai", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  -webkit-text-size-adjust: 100%;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f5fd;
  --bar: #f6f9ff;
  --side: #ffffff;
  --surface: #ffffff;
  --raised: #e9eff9;
  --hover: #dde7f7;
  --line: #d5e0f2;
  --text: #0c1b3a;
  --sub: #3d4f78;
  --muted: #53668f;
  --accent: #1c5fe0;
  --accent-ink: #ffffff;
  --active: #e1ecff;
  --active-line: #bcd3f7;
  --violet: #2f5bd1;
  --green: #1b7a5a;
  --blue: #1d5fb5;
  --amber: #8e5924;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { border: 0; background: none; }
a { color: inherit; text-decoration: none; }
a, button, input, select, summary { -webkit-tap-highlight-color: transparent; }
a, button { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.icon { display: inline-block; vertical-align: middle; width: 20px; height: 20px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 50; left: 12px; top: -100px; background: var(--surface); border: 1px solid var(--accent); padding: 10px 18px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.app-layout { display: grid; grid-template-columns: var(--rail) minmax(0,1fr); min-height: 100vh; }
.workspace { min-width: 0; }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 5; }
.brand-row { height: var(--header); padding: 0 24px; display: flex; align-items: center; flex: none; }
.brand { display: inline-flex; align-items: center; gap: 9px; width: max-content; color: var(--text); }
.brand img { width: 40px; height: 35px; display: block; }
.brand span { font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 28px; font-weight: 800; letter-spacing: -1.8px; line-height: 1; }
.side-navigation { padding: 25px 14px 14px; overflow-y: auto; }
.nav-group + .nav-group { margin-top: 21px; padding-top: 23px; border-top: 1px solid var(--line); }
.nav-caption { font-size: 11px; color: var(--muted); margin: 0 13px 10px; font-weight: 600; }
.nav-link { min-height: 43px; display: flex; align-items: center; gap: 13px; padding: 8px 13px; margin: 3px 0; color: var(--sub); font-size: 14px; border-radius: 8px; transition: color .15s, background .15s; }
.nav-link .icon { width: 19px; height: 19px; }
.nav-link:hover { background: var(--raised); color: var(--text); }
.nav-link[aria-current="page"] { color: var(--accent); background: var(--active); font-weight: 650; }
.side-category-icon { width: 19px; display: grid; place-items: center; }
.color-violet { color: var(--violet); } .color-green { color: var(--green); } .color-blue { color: var(--blue); }
.color-amber { color: var(--amber); } .color-neutral { color: var(--sub); }
.sidebar-bottom { margin: auto 14px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 17px 5px 0; }
.library-icon { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid var(--active-line); background: var(--active); border-radius: 11px; color: var(--accent); }
.library-icon .icon { width: 19px; height: 19px; }
.sidebar-bottom strong, .sidebar-bottom small { display: block; }
.sidebar-bottom strong { font-size: 12px; font-weight: 650; }
.sidebar-bottom small { color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.topbar { position: sticky; z-index: 4; top: 0; min-height: var(--header); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px var(--gutter); background: var(--bar); border-bottom: 1px solid var(--line); }
.crumb, .header-tools, .search-box, .theme-toggle { display: flex; align-items: center; }
.crumb { gap: 10px; flex: none; font-size: 13px; }
.crumb a, .crumb > .icon { color: var(--muted); }
.crumb > .icon:first-child { width: 17px; height: 17px; }
.crumb > .icon:nth-of-type(2) { width: 13px; height: 13px; opacity: .75; }
.crumb a:hover { color: var(--accent); }
.crumb span { font-weight: 600; }
.header-tools { justify-content: flex-end; gap: 14px; width: min(48%, 462px); }
.search-area { position: relative; flex: 1; min-width: 0; }
.search-box { width: 100%; height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; gap: 10px; padding: 0 11px; color: var(--muted); }
.search-box:focus-within { border-color: var(--accent); }
.search-box > .icon { width: 17px; height: 17px; }
.search-box input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 13px; height: 100%; }
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.search-box input::-webkit-search-cancel-button { display: none; }
kbd { font: 12px ui-monospace, monospace; }
.search-box kbd { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 4px; border: 1px solid var(--line); background: var(--raised); }
.search-clear { width: 26px; height: 28px; display: grid; place-items: center; color: var(--sub); }
.search-clear .icon { width: 15px; height: 15px; }
.theme-toggle { width: 38px; height: 38px; flex: none; justify-content: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--sub); }
.theme-toggle:hover { color: var(--accent); border-color: var(--active-line); }
.theme-toggle .icon { width: 18px; height: 18px; }
.mobile-brand, .mobile-nav { display: none; }
.suggestions { position: absolute; z-index: 8; top: calc(100% + 7px); right: 0; left: 0; padding: 5px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: 0 12px 40px #00000033; }
.suggestions a, .suggestions p { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 9px 11px; border-radius: 7px; margin: 0; }
.suggestions a:hover, .suggestions a:focus-visible { background: var(--raised); }
.suggestions .icon { width: 13px; color: var(--accent); }
.content { max-width: 1730px; margin: 0 auto; padding: 25px var(--gutter) 55px; container-type: inline-size; }
.content:focus { outline: none; }
.feature { position: relative; isolation: isolate; display: flex; align-items: center; min-height: clamp(298px, 24vw, 365px); overflow: hidden; border-radius: 17px; background: #101a30; color: #f7fbfe; margin-bottom: 30px; box-shadow: inset 0 0 0 1px #ffffff0d; }
.feature-image, .feature-scrim { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.feature-image { object-fit: cover; object-position: 66% 53%; }
.feature-scrim { background: linear-gradient(90deg, rgba(9,14,18,.97) 0%, rgba(12,20,26,.89) 19%, rgba(14,24,34,.62) 39%, rgba(13,23,31,.07) 66%, transparent 85%), linear-gradient(0deg, rgba(8,15,21,.58), transparent 40%); }
.feature:after { content: ""; position: absolute; pointer-events: none; inset: 0; border-radius: inherit; border: solid 1px #ffffff16; }
.feature-copy { padding: 29px clamp(24px,3.05vw,49px); max-width: 64%; }
.feature-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px 3px 8px; border: 1px solid #88c3f477; border-radius: 30px; color: #cee8ff; background: #334b609c; font-size: 11.5px; font-weight: 650; }
.feature-badge .icon { width: 16px; height: 16px; }
.feature h2 { margin: 12px 0 9px; max-width: 8.8em; font-size: clamp(37px,3.45vw,59px); line-height: 1.2; letter-spacing: -.045em; font-weight: 750; text-wrap: balance; text-shadow: 0 2px 15px #0811194d; }
.feature-meta, .feature-meta span { display: flex; align-items: center; }
.feature-meta { gap: 10px; color: #d0d6e0; font-size: 12.5px; }
.feature-meta span { gap: 5px; }
.feature-meta .icon { width: 15px; height: 15px; color: #ccd8e3; }
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7; flex: none; }
.feature-actions, .watch-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.feature-actions { margin-top: 22px; }
.primary-button, .soft-button, .favorite-feature, .favorite-action, .tool-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; line-height: 1.4; transition: background .15s, transform .15s, border-color .15s; }
.primary-button, .soft-button, .favorite-feature, .favorite-action { min-height: 40px; padding: 8px 15px; font-size: 13px; font-weight: 650; }
.primary-button { color: #0f1b26; background: #95cfff; border: 1px solid #a7d7ff; }
.primary-button:hover { background: #b1dcff; transform: translateY(-1px); }
.primary-button .icon { width: 17px; height: 17px; }
.favorite-feature { color: #f2f6fa; background: #141f3b99; border: 1px solid #e0eaf35c; backdrop-filter: blur(5px); }
.favorite-feature:hover, .favorite-feature.saved { background: #243a6d; }
.favorite-feature .icon, .favorite-action .icon, .soft-button .icon { width: 16px; height: 16px; }
.favorite.saved .icon { fill: currentColor; }
.slide-controls { position: absolute; bottom: 20px; right: 21px; display: flex; align-items: center; gap: 6px; }
.slide-controls button[data-step] { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border-radius: 7px; border: 1px solid #ffffff42; color: white; background: #0d1527b5; backdrop-filter: blur(5px); }
.slide-controls button[data-step]:hover { background: #1f315c; }
.slide-controls .icon { width: 15px; height: 15px; }
.slide-dots { display: flex; align-items: center; gap: 0; padding: 0 2px; }
.slide-dot { display: grid; place-items: center; height: 28px; padding: 0 3px; }
.slide-dot i { display: block; width: 5px; height: 5px; background: #b8c1cf; border-radius: 6px; }
.slide-dot[aria-pressed="true"] i { width: 17px; background: #9bd1ff; }
.section-heading, .heading-group { display: flex; align-items: center; }
.section-heading { justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.heading-group { gap: 10px; min-width: 0; }
.section-heading h1, .section-heading h2 { font-size: clamp(22px,1.8vw,30px); line-height: 1.35; letter-spacing: -.035em; font-weight: 700; margin: 0; }
.count { white-space: nowrap; color: var(--sub); background: var(--raised); padding: 2px 8px; border: 1px solid var(--line); font-size: 11px; border-radius: 20px; }
.sort-wrap { position: relative; display: inline-flex; align-items: center; color: var(--sub); font-size: 12px; }
.sort-wrap > span:first-child { position: absolute; left: 9px; pointer-events: none; display: flex; }
.sort-wrap .icon { width: 15px; height: 15px; }
.sort-wrap select { appearance: none; color: var(--sub); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 6px 24px 6px 30px; line-height: 1.45; height: 33px; }
.select-angle { position: absolute; right: 11px; top: calc(50% - 4px); width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); pointer-events: none; }
.filters { display: flex; gap: 8px; margin: 0 0 21px; overflow-x: auto; scrollbar-width: thin; padding: 3px 2px; }
.filter-chip { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--sub); display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; border-radius: 8px; padding: 6px 13px; min-height: 34px; }
.filter-chip .icon { width: 15px; height: 15px; }
.filter-chip:hover { background: var(--hover); color: var(--text); }
.filter-chip[aria-pressed="true"] { background: #89c0ee; color: #14212d; border-color: #97c9f3; font-weight: 650; }
.video-grid, .continue-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 25px 20px; }
.video-card { min-width: 0; }
.thumb-link { display: block; border-radius: 12px; }
.thumb { position: relative; isolation: isolate; aspect-ratio: 16/9; overflow: hidden; background: var(--surface); border-radius: 12px; }
.thumb:after { content: ""; position: absolute; inset: 0; border: 1px solid #ffffff12; border-radius: inherit; pointer-events: none; }
.thumb img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .32s ease; }
.thumb-play { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; background: #0c1324cc; color: white; opacity: 0; transform: translate(-50%,-49%) scale(.9); transition: opacity .18s, transform .18s; }
.thumb-play .icon { width: 18px; height: 18px; }
a:focus-visible .thumb-play { opacity: 1; transform: translate(-50%,-50%); }
@media (hover: hover) {
  a:hover .thumb img { transform: scale(1.035); }
  a:hover .thumb-play { opacity: 1; transform: translate(-50%,-50%); }
}
.duration, .watched-mark { position: absolute; border-radius: 4px; background: #060a14db; color: #ffffff; display: inline-flex; align-items: center; }
.duration { bottom: 7px; right: 7px; padding: 2px 6px; font: 650 11.5px/1.4 system-ui,sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .1px; }
.watched-mark { left: 7px; top: 7px; gap: 3px; padding: 2px 6px; font-size: 10.5px; }
.watched-mark .icon { width: 12px; height: 12px; color: #afdaff; }
.progress-track { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: #28417a; }
.progress-track span { display: block; height: 100%; background: #8ac9ff; }
.card-details { padding: 10px 0 0; }
.card-head { display: flex; gap: 5px; align-items: flex-start; justify-content: space-between; min-width: 0; }
.card-head h3 { font-size: clamp(15px,1.17vw,19px); letter-spacing: -.022em; font-weight: 650; line-height: 1.48; margin: 0; min-width: 0; }
.card-head h3 a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-head h3 a:hover { color: var(--accent); }
.favorite-icon { flex: none; width: 26px; height: 27px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); padding: 0; margin: -1px -3px 0 0; }
.favorite-icon:hover, .favorite-icon.saved { background: var(--active); color: var(--accent); }
.favorite-icon .icon { width: 16px; height: 16px; }
.card-meta, .watch-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 11.5px; }
.category-tag { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; font-size: inherit; }
.category-tag .icon { width: 13px; height: 13px; }
.card-meta { margin-top: 3px; }
.continue-section { margin-bottom: 28px; }
.continue-card { display: grid; grid-template-columns: 36% 1fr; align-items: center; gap: 11px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; }
.continue-card .thumb { border-radius: 6px; }
.continue-card .duration { display: none; }
.continue-card strong, .continue-card small { display: block; }
.continue-card strong { color: var(--text); font-size: 13px; line-height: 1.45; font-weight: 600; }
.continue-card small { color: var(--muted); font-size: 10.5px; margin-top: 3px; }
.text-link { color: var(--accent); font-size: 12px; }
.text-link:hover { text-decoration: underline; }
.empty-state { padding: 48px 20px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; }
.empty-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; color: var(--accent); border-radius: 16px; background: var(--active); }
.empty-icon .icon { width: 25px; height: 25px; }
.empty-state h2, .empty-state h1 { margin: 14px 0 5px; font-size: 22px; }
.empty-state p { color: var(--sub); margin: 0 0 18px; }
.soft-button, .favorite-action { color: var(--sub); background: var(--surface); border: 1px solid var(--line); }
.soft-button:hover, .favorite-action:hover, .favorite-action.saved { color: var(--accent); background: var(--active); border-color: var(--active-line); }
.toast { position: fixed; z-index: 12; bottom: 24px; left: calc(50% + var(--rail) / 2); transform: translateX(-50%); padding: 10px 18px; max-width: calc(100% - 30px); border: 1px solid var(--active-line); border-radius: 10px; background: var(--surface); box-shadow: 0 6px 28px #00000033; color: var(--text); text-align: center; }
.noscript { padding: 20px; background: #eaf5ff; color: #17222c; }

.watch-content { padding-top: 20px; }
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--sub); font-size: 12.5px; margin-bottom: 15px; }
.back-link:hover { color: var(--accent); }
.back-link .icon { width: 15px; height: 15px; }
.watch-grid { display: grid; grid-template-columns: minmax(0,2.7fr) minmax(220px,1fr); gap: 24px; }
.watch-primary, .related { min-width: 0; }
.player-frame { background: #04070e; aspect-ratio: 16/9; position: relative; overflow: hidden; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); }
.player-frame video { display: block; width: 100%; height: 100%; object-fit: contain; background: #04070e; }
.player-frame:fullscreen { width: 100%; height: 100%; border-radius: 0; }
.player-state { position: absolute; inset: 0; color: #ffffff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 14px; text-align: center; background: #091015c9; }
.player-state h2 { font-size: clamp(17px,2vw,24px); margin: 0; }
.player-state p { font-size: 13px; color: #cdd3dd; margin: 0; }
.player-state > .icon { width: 29px; height: 29px; color: #a1d4ff; }
.player-state a { font-size: 12px; color: #b6ddff; }
.player-tools { display: flex; gap: 6px 12px; align-items: center; justify-content: flex-start; flex-wrap: wrap; margin: 11px 0 16px; }
.tool-button, .speed-label, .key-help summary { gap: 6px; display: inline-flex; align-items: center; color: var(--muted); background: transparent; border: 0; font-size: 12px; padding: 4px 5px; }
.tool-button:hover, .key-help summary:hover { color: var(--accent); }
.tool-button .icon, .key-help .icon, .speed-label .icon { height: 15px; width: 15px; }
.speed-label select { border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--text); font: 600 12px system-ui,sans-serif; padding: 3px 4px; }
.tool-button:disabled, .speed-label select:disabled { opacity: .5; cursor: default; }
.key-help { position: relative; }
.key-help summary { cursor: pointer; list-style: none; }
.key-help summary::-webkit-details-marker { display: none; }
.shortcut-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 13px; position: absolute; z-index: 3; top: 100%; min-width: 215px; left: 0; margin: 4px 0 0; border: 1px solid var(--line); border-radius: 9px; padding: 12px; background: var(--surface); box-shadow: 0 8px 24px #00000033; font-size: 12px; }
.shortcut-list dt { color: var(--accent); font-family: system-ui,sans-serif; }
.shortcut-list dd { color: var(--sub); margin: 0; }
.watch-meta { font-size: 12.5px; gap: 10px; }
.watch-meta time { display: inline-flex; align-items: center; gap: 5px; }
.watch-meta .icon { width: 15px; height: 15px; }
.video-header h1 { margin: 7px 0 14px; font-size: clamp(22px,2.15vw,36px); line-height: 1.4; letter-spacing: -.035em; overflow-wrap: anywhere; }
.watch-actions { gap: 8px; }
.watch-actions button { min-height: 36px; }
.description-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-top: 19px; padding: 15px 18px; }
.description-box h2 { font-size: 14px; margin: 0 0 5px; }
.description-box p { margin: 0; color: var(--sub); white-space: pre-line; overflow-wrap: anywhere; }
.related h2 { font-size: 18px; margin: 0 0 12px; }
.related h2.related-heading { margin-top: 20px; }
.next-card { position: relative; display: block; padding: 9px; border-radius: 13px; border: solid 1px var(--line); background: var(--surface); }
.next-card .thumb { border-radius: 8px; }
.next-card strong, .related-card strong { display: block; font-weight: 650; line-height: 1.45; }
.next-card strong { font-size: 14px; margin: 8px 0 2px; }
.next-card .next-play { position: absolute; left: 18px; top: 18px; display: flex; align-items: center; gap: 4px; color: #ffffff; background: #16232dc9; border-radius: 5px; padding: 3px 7px; font-size: 10px; }
.next-play .icon { width: 13px; height: 13px; }
.related-card { display: grid; grid-template-columns: minmax(78px,38%) 1fr; gap: 9px; align-items: center; margin-block: 11px; }
.related-card .thumb { border-radius: 7px; }
.related-card strong { font-size: 12.5px; }
.related-card .card-meta { margin-top: 4px; font-size: 10.5px; }
.related-card .duration { font-size: 9px; padding: 1px 4px; right: 4px; bottom: 4px; }
.related-card:hover strong, .next-card:hover strong { color: var(--accent); }
.copy-fallback { margin-top: 10px; }
.copy-fallback label { display: grid; gap: 5px; color: var(--sub); font-size: 12px; }
.copy-fallback input { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: var(--surface); }
.invalid { margin: 15px auto; max-width: 720px; }
.invalid .error-code { font: 700 58px/1 system-ui,sans-serif; color: var(--accent); letter-spacing: -.06em; }
@container (max-width: 860px) {
  .watch-grid { grid-template-columns: 1fr; }
  .related { padding-top: 14px; border-top: 1px solid var(--line); }
  .next-card { max-width: 330px; }
  .related-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
}
@container (max-width: 730px) {
  .video-grid, .continue-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px 15px; }
  .feature h2 { font-size: 38px; }
  .feature-copy { max-width: 63%; }
}
@media (min-width: 1650px) {
  :root { --rail: 245px; }
  .video-grid { gap: 28px 24px; }
}
@media (max-width: 1080px) and (min-width: 701px) {
  :root { --rail: 78px; }
  .brand-row { justify-content: center; padding: 0; }
  .sidebar .brand span, .sidebar .nav-link > span:not(.side-category-icon), .nav-caption, .sidebar-bottom > div { display: none; }
  .side-navigation { padding: 24px 13px 12px; }
  .nav-link { justify-content: center; padding: 10px; }
  .nav-link .icon { width: 21px; height: 21px; }
  .sidebar-bottom { padding: 15px 0 0; justify-content: center; }
}
@media (max-width: 700px) {
  :root { --rail: 0px; --gutter: 18px; --header: 60px; }
  .app-layout { display: block; }
  .sidebar, .crumb { display: none; }
  .mobile-brand { display: flex; }
  .topbar { position: relative; padding: 9px var(--gutter); gap: 12px; }
  .brand span { font-size: 25px; }
  .brand img { width: 34px; height: 30px; }
  .header-tools { width: min(65%,430px); gap: 8px; }
  .mobile-nav { position: fixed; z-index: 6; display: flex; align-items: center; justify-content: space-around; bottom: 0; left: 0; right: 0; padding: 3px 8px calc(3px + env(safe-area-inset-bottom)); background: var(--side); border-top: 1px solid var(--line); }
  .mobile-nav .nav-link { gap: 2px; padding: 3px 15px; min-height: 44px; margin: 1px 0; flex-direction: column; justify-content: center; font-size: 10px; line-height: 1.4; }
  .mobile-nav .nav-link[aria-current="page"] { background: transparent; }
  .mobile-nav .nav-link .icon { width: 20px; height: 20px; }
  .content { padding-top: 17px; padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  .feature { min-height: 275px; margin-bottom: 24px; border-radius: 14px; }
  .feature-copy { padding: 25px; }
  .feature h2 { font-size: 36px; }
  .feature-actions { margin-top: 17px; }
  .toast { bottom: calc(65px + env(safe-area-inset-bottom)); }
  .section-heading { margin-bottom: 10px; }
  .filters { margin-bottom: 16px; }
  .search-box input { font-size: 16px; }
  .search-box input::placeholder { font-size: 13px; }
  .search-box kbd { display: none; }
}
@media (max-width: 510px) {
  :root { --gutter: 15px; }
  .topbar { display: grid; grid-template-columns: 1fr auto; gap: 9px; padding-top: 8px; padding-bottom: 11px; }
  .header-tools { display: contents; }
  .search-area { grid-row: 2; grid-column: 1/-1; }
  .theme-toggle { grid-row: 1; grid-column: 2; width: 34px; height: 34px; }
  .search-box { height: 37px; }
  .content { padding-top: 14px; }
  .feature { min-height: 328px; display: flex; align-items: flex-end; }
  .feature-image { object-position: 68% 44%; }
  .feature-scrim { background: linear-gradient(0deg,#0b1218 0%,#111921eb 16%,#101820bf 36%,#080d1830 67%,#0d14191a); }
  .feature-copy { max-width: 100%; padding: 19px; }
  .feature h2 { font-size: clamp(29px,8.5vw,39px); max-width: 8.55em; line-height: 1.2; margin: 8px 0 6px; }
  .feature-badge { font-size: 10px; padding: 2px 8px; }
  .feature-badge .icon { width: 13px; height: 13px; }
  .feature-meta { font-size: 11px; }
  .feature-actions { margin-top: 12px; gap: 7px; }
  .feature-actions .primary-button, .favorite-feature { min-height: 36px; font-size: 12px; padding: 7px 11px; }
  .slide-controls { bottom: 19px; right: 13px; gap: 2px; }
  .slide-controls button[data-step] { width: 25px; height: 27px; border-radius: 5px; }
  .slide-dot { padding: 0 2px; }
  .slide-dot[aria-pressed="true"] i { width: 12px; }
  .filters { margin-right: calc(0px - var(--gutter)); padding-right: var(--gutter); scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter-chip { gap: 5px; padding: 6px 11px; font-size: 12px; }
  .video-grid, .continue-grid { grid-template-columns: minmax(0,1fr); }
  .video-grid { row-gap: 22px; }
  .card-details { padding-top: 9px; }
  .card-head h3 { font-size: 16px; }
  .card-meta { font-size: 12px; }
  .favorite-icon { width: 35px; height: 32px; }
  .section-heading h1, .section-heading h2 { font-size: 21px; }
  .heading-group { gap: 7px; }
  .continue-grid { gap: 8px; }
  .continue-card { grid-template-columns: 90px 1fr; }
  .related-list { grid-template-columns: 1fr; }
  .related-card { max-width: 450px; }
  .shortcut-list { left: auto; right: 0; }
}
@media (max-width: 355px) {
  .slide-controls { top: 12px; bottom: auto; }
  .feature-actions { gap: 5px; }
  .count { padding: 2px 5px; font-size: 10px; }
  .player-tools { column-gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

.watch-grid.single-video { grid-template-columns: minmax(0,1fr); }

/* ===== NguTube: glow, motion and responsive layer (safe to edit or delete) ===== */
html { scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #24408a transparent; }
::selection { background: rgba(var(--glow), .35); }
body::before { content: ""; position: fixed; inset: -20vmax; z-index: -1; pointer-events: none;
  background: radial-gradient(42vmax 30vmax at 12% 0, rgba(var(--glow), .12), transparent 70%), radial-gradient(46vmax 34vmax at 100% 35%, rgba(88, 96, 255, .12), transparent 70%);
  animation: aurora 26s ease-in-out infinite alternate; }
:root[data-theme="light"] body::before { opacity: .45; }
@keyframes aurora { to { transform: translate3d(3vmax, 2vmax, 0) scale(1.06); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* page transitions (cross-page fade in browsers that support it) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .18s ease both; }
::view-transition-new(root) { animation: vt-in .28s ease both; }

/* entrance animations (replay when filters re-render the grid) */
.content > *, .watch-grid > *, .video-card, .continue-card, .related-card { animation: rise .6s var(--ease) both; }
.content > :nth-child(2), .watch-grid > :nth-child(2), .video-grid > :nth-child(2) { animation-delay: .06s; }
.content > :nth-child(3), .video-grid > :nth-child(3) { animation-delay: .12s; }
.video-grid > :nth-child(4) { animation-delay: .18s; }
.video-grid > :nth-child(n+5) { animation-delay: .24s; }
.player-frame, .toast, .empty-state { animation: pop .45s var(--ease) both; }

/* glass bars */
.topbar { background: color-mix(in srgb, var(--bar) 76%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); transition: box-shadow .3s; }
.topbar.is-scrolled { box-shadow: 0 12px 30px -16px rgba(0, 0, 0, .65), 0 1px 0 rgba(var(--glow), .2); }
.mobile-nav { background: color-mix(in srgb, var(--bar) 84%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }

/* brand */
.brand img { width: 38px; height: 38px; filter: drop-shadow(0 0 8px rgba(var(--glow), .45)); transition: transform .45s var(--ease); }
.brand span { font-size: 26px; letter-spacing: -1.4px; }
.brand span b { font-weight: 800; background: linear-gradient(90deg, #7df3ff, #5aa2ff 60%, #8f7bff); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* navigation */
.nav-link { position: relative; transition: background-color .25s, color .25s, transform .3s var(--ease), box-shadow .3s; }
.nav-link[aria-current="page"] { color: var(--accent); box-shadow: inset 0 0 0 1px var(--active-line), 0 0 22px -8px rgba(var(--glow), .6); }
.sidebar .nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -1px; top: 24%; bottom: 24%; width: 3px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* interactive elements */
.primary-button, .soft-button, .filter-chip, .favorite-icon, .favorite-feature, .favorite-action, .tool-button, .theme-toggle { transition: transform .25s var(--ease), box-shadow .3s, background-color .25s, border-color .25s, color .25s; }
.primary-button { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #5a5cff)); box-shadow: 0 6px 20px -8px rgba(var(--glow), .7); }
:root[data-theme="light"] .primary-button { color: #fff; }
.primary-button:active, .soft-button:active, .filter-chip:active, .favorite-icon:active, .theme-toggle:active, .tool-button:active { transform: scale(.95); }
.search-box { transition: box-shadow .3s, border-color .3s; }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--glow), .15), 0 0 26px -6px rgba(var(--glow), .5); }
.thumb { transition: box-shadow .4s var(--ease); }
.feature { box-shadow: 0 26px 60px -30px rgba(var(--glow), .5); }
.feature-image { transition: transform 9s ease-out; }
.player-frame { box-shadow: 0 30px 80px -34px rgba(var(--glow), .45), 0 0 0 1px rgba(var(--glow), .16); }

@media (hover: hover) {
  .nav-link:hover { transform: translateX(3px); }
  .video-card, .continue-card, .related-card { transition: transform .4s var(--ease); }
  .video-card:hover, .continue-card:hover { transform: translateY(-5px); }
  .related-card:hover { transform: translateX(4px); }
  .video-card:hover .thumb, .continue-card:hover .thumb, .related-card:hover .thumb { box-shadow: 0 16px 36px -14px rgba(var(--glow), .6), 0 0 0 1px rgba(var(--glow), .45); }
  .brand:hover img { transform: rotate(-8deg) scale(1.1); }
  .primary-button:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -6px rgba(var(--glow), .8); }
  .soft-button:hover, .filter-chip:hover, .tool-button:hover, .theme-toggle:hover { transform: translateY(-1px); border-color: rgba(var(--glow), .5); }
  .feature:hover .feature-image { transform: scale(1.045); }
}

/* responsive */
.video-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.continue-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); }
.topbar { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
@media (max-width: 1100px) {
  .watch-grid { grid-template-columns: minmax(0, 1fr); }
  .related-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 6px 16px; }
  .related-card { max-width: none; }
}
@media (max-width: 700px) {
  .brand img { width: 34px; height: 34px; }
  .brand span { font-size: 24px; }
  .mobile-nav .nav-link[aria-current="page"] { box-shadow: none; }
  .mobile-nav .nav-link::before { display: none; }
  .video-card:active .thumb { box-shadow: 0 0 0 1px rgba(var(--glow), .45); }
}
@media (max-height: 480px) and (orientation: landscape) { .player-frame { width: min(100%, calc((100dvh - 24px) * 16 / 9)); margin-inline: auto; } }
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
