:root {
  color-scheme: dark;
  --bg: #050a12;
  --surface: #0a1422;
  --surface-2: #101e30;
  --surface-3: #15283f;
  --line: rgba(161, 197, 230, .16);
  --text: #f4f9ff;
  --muted: #9bb0c6;
  --blue: #188bff;
  --blue-2: #53c8ff;
  --violet: #7258ff;
  --danger: #ff6076;
  --focus: #9de5ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, .38);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100%; margin: 0; color: var(--text); background:
  radial-gradient(circle at 70% -10%, rgba(30, 120, 255, .17), transparent 36rem),
  radial-gradient(circle at 10% 100%, rgba(77, 57, 210, .13), transparent 32rem), var(--bg); }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: .75rem; left: .75rem; padding: .7rem 1rem; border-radius: .7rem; background: #fff; color: #07111f; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; display: grid; grid-template: 76px 1fr / 248px 1fr; }
.topbar { position: sticky; z-index: 20; top: 0; grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 1.4rem; border-bottom: 1px solid var(--line); background: rgba(5, 10, 18, .88); backdrop-filter: blur(20px); }
.brand { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; }
.brand img { border-radius: 12px; box-shadow: 0 8px 32px rgba(8, 124, 255, .22); }
.brand span { display: grid; line-height: 1.05; }
.brand strong { font-size: 1rem; letter-spacing: .015em; }
.brand small { margin-top: .26rem; color: var(--blue-2); font-size: .78rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: .7rem; }
.network-state { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .7rem; color: var(--muted); font-size: .84rem; }
.network-state i { width: .48rem; height: .48rem; border-radius: 50%; background: #39d98a; box-shadow: 0 0 0 4px rgba(57, 217, 138, .1); }
.network-state.offline i { background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 96, 118, .1); }
.icon-button { display: inline-grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; }
.icon-button:hover { border-color: rgba(83, 200, 255, .48); background: var(--surface-2); }

.side-nav { position: sticky; top: 76px; align-self: start; height: calc(100vh - 76px); display: flex; flex-direction: column; gap: .35rem; padding: 1.4rem 1rem; border-right: 1px solid var(--line); background: rgba(5, 10, 18, .46); }
.nav-item { position: relative; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; min-height: 52px; gap: .7rem; padding: .55rem .8rem; border: 1px solid transparent; border-radius: 14px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .035); }
.nav-item.active { color: #fff; border-color: rgba(61, 175, 255, .24); background: linear-gradient(90deg, rgba(24, 139, 255, .21), rgba(24, 139, 255, .04)); }
.nav-item.active::before { content: ""; position: absolute; left: -1rem; width: 3px; height: 28px; border-radius: 0 4px 4px 0; background: var(--blue-2); }
.nav-item b { min-width: 1.6rem; padding: .14rem .35rem; border-radius: 999px; background: rgba(255, 255, 255, .07); color: var(--muted); font-size: .74rem; text-align: center; }

.workspace { width: min(100%, 1500px); margin: 0 auto; padding: 1.5rem clamp(1rem, 2.5vw, 2.5rem) 2.5rem; }
.player-card, .command-card, .library-card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(16, 30, 48, .92), rgba(7, 17, 31, .92)); box-shadow: var(--shadow); overflow: hidden; }
.player-stage { position: relative; aspect-ratio: 16/9; max-height: min(70vh, 820px); background: #02050a; overflow: hidden; }
.player-mount, .player-mount iframe { width: 100%; height: 100%; border: 0; }
.player-mount { display: block; background: #000; object-fit: contain; }
.player-mount[hidden] { display: none; }
.empty-player { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; padding: 2rem; text-align: center; background:
  linear-gradient(rgba(3, 8, 15, .72), rgba(3, 8, 15, .9)),
  radial-gradient(circle at 50% 30%, rgba(24, 139, 255, .34), transparent 34%); }
.empty-player img { filter: drop-shadow(0 18px 38px rgba(14, 128, 255, .28)); }
.empty-player h1 { margin: 1.3rem 0 .45rem; font-size: clamp(1.35rem, 3vw, 2.3rem); }
.empty-player p { max-width: 34rem; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.now-playing { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-top: 1px solid var(--line); }
.now-text { min-width: 0; }
.now-text h1 { max-width: 56rem; margin: .2rem 0 0; overflow: hidden; font-size: clamp(1rem, 2vw, 1.35rem); text-overflow: ellipsis; white-space: nowrap; }
.now-text p { margin: .24rem 0 0; color: var(--muted); font-size: .84rem; }
.eyebrow { color: var(--blue-2); font-size: .75rem; font-weight: 780; letter-spacing: .13em; text-transform: uppercase; }
.player-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
.action-button { display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); color: var(--muted); cursor: pointer; }
.action-button:hover, .action-button[aria-pressed="true"] { color: #fff; border-color: rgba(83, 200, 255, .4); background: rgba(24, 139, 255, .13); }

.command-card, .library-card { margin-top: 1.1rem; padding: clamp(1rem, 2vw, 1.5rem); }
.command-card { margin-top: 0; }
.category-strip { display: flex; gap: .55rem; margin-top: 1rem; overflow-x: auto; padding: .15rem 0 .35rem; scrollbar-width: thin; }
.category-chip { flex: 0 0 auto; min-height: 38px; border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; background: rgba(255,255,255,.04); color: var(--muted); font-weight: 720; cursor: pointer; }
.category-chip:hover, .category-chip.active { border-color: var(--blue-2); background: rgba(24,139,255,.18); color: #fff; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading h2 { margin: .25rem 0 0; font-size: clamp(1.15rem, 2vw, 1.45rem); }
.privacy-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .7rem; border: 1px solid rgba(83, 200, 255, .2); border-radius: 999px; background: rgba(24, 139, 255, .08); color: #bfeaff; font-size: .78rem; }
.privacy-pill svg { width: 1rem; height: 1rem; }
.engine-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: 0 0 1rem; border: 0; padding: 0; }
.engine-switch label { position: relative; display: block; cursor: pointer; }
.engine-switch input { position: absolute; opacity: 0; pointer-events: none; }
.engine-switch span { display: grid; gap: .2rem; min-height: 68px; align-content: center; border: 1px solid var(--line); border-radius: 15px; padding: .75rem 1rem; background: rgba(2, 7, 13, .4); }
.engine-switch small { color: var(--muted); }
.engine-switch input:checked + span { border-color: var(--blue-2); background: linear-gradient(135deg, rgba(24, 139, 255, .22), rgba(79, 95, 255, .09)); box-shadow: inset 0 0 0 1px rgba(83, 200, 255, .15); }
.engine-switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.play-form { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: .7rem; }
.input-shell { display: flex; align-items: center; min-height: 52px; padding: 0 .45rem 0 .9rem; border: 1px solid var(--line); border-radius: 15px; background: rgba(2, 7, 13, .52); }
.input-shell:focus-within { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(83, 200, 255, .12); }
.input-shell svg { flex: 0 0 auto; color: var(--muted); }
.input-shell input { min-width: 0; flex: 1; height: 50px; border: 0; outline: 0; padding: 0 .75rem; background: transparent; color: var(--text); font-size: 1rem; }
.input-shell input::placeholder { color: #73869b; }
.primary-button, .secondary-button, .danger-button, .text-button { min-height: 44px; border-radius: 12px; padding: .65rem .95rem; font-weight: 720; cursor: pointer; }
.primary-button { border: 1px solid #3daaff; background: linear-gradient(135deg, #087cff, #4f5fff); color: white; box-shadow: 0 10px 30px rgba(8, 124, 255, .23); }
.primary-button:hover { filter: brightness(1.12); }
.secondary-button { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.secondary-button:hover { border-color: rgba(83, 200, 255, .5); }
.danger-button { border: 1px solid rgba(255, 96, 118, .35); background: rgba(255, 96, 118, .09); color: #ffafba; }
.text-button { min-height: 36px; border: 0; background: transparent; color: var(--blue-2); }
.text-button:hover { color: #fff; }
.form-note { margin: .7rem 0 0; color: var(--muted); font-size: .85rem; }
.form-note.error { color: #ff9cac; }

.video-list { display: grid; gap: .7rem; }
.video-list.discovery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.15rem; }
.video-row.video-card { display: flex; min-width: 0; flex-direction: column; align-items: stretch; gap: .7rem; padding: 0 0 .8rem; overflow: hidden; border: 0; background: transparent; }
.video-row.video-card:hover { background: rgba(11,30,50,.5); }
.video-row.video-card .video-thumb { width: 100%; border-radius: 14px; }
.video-row.video-card .video-info { padding: 0 .35rem; }
.video-row.video-card .video-info strong { display: -webkit-box; min-height: 2.6em; overflow: hidden; line-height: 1.3; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.video-row.video-card .row-actions { justify-content: flex-end; padding: 0 .35rem; }
.video-row { display: grid; grid-template-columns: 154px minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: .7rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(2, 7, 13, .35); }
.video-row:hover { border-color: rgba(83, 200, 255, .34); background: rgba(11, 30, 50, .65); }
.video-thumb { position: relative; aspect-ratio: 16/9; border: 0; border-radius: 11px; padding: 0; overflow: hidden; background: var(--surface-3); cursor: pointer; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-thumb::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.2); color: white; opacity: 0; transition: opacity .18s ease; }
.video-thumb:hover::after, .video-thumb:focus-visible::after { opacity: 1; }
.video-info { min-width: 0; }
.video-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-info small { display: block; margin-top: .35rem; color: var(--muted); }
.row-actions { display: flex; gap: .35rem; }
.row-actions button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: transparent; cursor: pointer; }
.row-actions button:hover { background: var(--surface-3); }
.empty-list { display: grid; justify-items: center; padding: 2.4rem 1rem; text-align: center; }
.empty-list > svg { width: 2.3rem; height: 2.3rem; color: var(--blue-2); }
.empty-list h3 { margin: .8rem 0 .3rem; }
.empty-list p { margin: 0; color: var(--muted); }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.8rem .2rem .2rem; color: var(--muted); font-size: .82rem; }
footer nav { display: flex; gap: 1rem; }
footer a:hover { color: var(--text); }

.settings-dialog { width: min(680px, calc(100% - 2rem)); max-height: min(840px, calc(100vh - 2rem)); border: 1px solid var(--line); border-radius: 22px; padding: 0; overflow: auto; background: #0a1422; color: var(--text); box-shadow: var(--shadow); }
.settings-dialog::backdrop { background: rgba(0, 4, 10, .78); backdrop-filter: blur(6px); }
.dialog-shell { padding: 1.2rem; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; }
.dialog-header h2 { margin: .25rem 0 0; }
.connection-panel { display: grid; gap: .8rem; padding: 1rem; border: 1px solid rgba(83, 200, 255, .22); border-radius: 16px; background: rgba(24, 139, 255, .06); }
.connection-panel strong, .connection-panel small, .connection-panel label { display: block; }
.connection-panel small { margin-top: .3rem; color: var(--muted); line-height: 1.4; }
.connection-panel label { color: var(--muted); font-size: .78rem; font-weight: 720; }
.connection-panel input, .connection-panel select { width: 100%; min-height: 44px; margin-top: .35rem; border: 1px solid var(--line); border-radius: 11px; padding: .55rem .7rem; outline: 0; background: #050b14; color: var(--text); font: inherit; }
.connection-panel input:focus, .connection-panel select:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(83, 200, 255, .12); }
.credential-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
#serverTestStatus { align-self: center; color: var(--muted); font-size: .82rem; }
#serverTestStatus.success { color: #7ce2b3; }
#serverTestStatus.error { color: #ff9cac; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; padding: .8rem 0; border-top: 1px solid var(--line); }
.setting-row strong, .setting-row small { display: block; }
.setting-row small { max-width: 33rem; margin-top: .3rem; color: var(--muted); line-height: 1.4; }
.setting-row.stacked { align-items: flex-end; }
.switch { position: relative; flex: 0 0 auto; width: 52px; height: 30px; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-3); cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #dcecff; transition: transform .2s ease; }
.switch input:checked + span { border-color: var(--blue); background: var(--blue); }
.switch input:checked + span::after { transform: translateX(22px); background: white; }
.switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.button-row { display: flex; gap: .5rem; }
.file-button { display: inline-flex; align-items: center; justify-content: center; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.text-link { color: var(--blue-2); }
.install-steps { display: grid; gap: .7rem; padding: .3rem 0 1.2rem; }
.install-step { display: grid; grid-template-columns: 36px 1fr; gap: .8rem; padding: .9rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.install-step b { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: rgba(24, 139, 255, .18); color: var(--blue-2); }
.install-step strong, .install-step span { display: block; }
.install-step span { margin-top: .25rem; color: var(--muted); line-height: 1.45; }
.toast { position: fixed; z-index: 120; left: 50%; bottom: max(1.4rem, env(safe-area-inset-bottom)); max-width: min(90vw, 560px); padding: .8rem 1rem; border: 1px solid rgba(83, 200, 255, .35); border-radius: 13px; background: #102238; color: #fff; box-shadow: var(--shadow); transform: translate(-50%, 180%); transition: transform .22s ease; }
.toast.visible { transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .app-shell { grid-template: 68px 1fr 68px / 1fr; }
  .topbar { height: 68px; padding: 0 .85rem; }
  .brand span { display: none; }
  .network-state span { display: none; }
  .side-nav { position: fixed; z-index: 30; inset: auto 0 0; height: calc(64px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding: .35rem .35rem env(safe-area-inset-bottom); border: 1px solid var(--line); border-width: 1px 0 0; background: rgba(5, 10, 18, .94); backdrop-filter: blur(20px); }
  .nav-item { grid-template: 24px 1fr; justify-items: center; gap: .1rem; min-height: 54px; padding: .2rem; border-radius: 10px; font-size: .68rem; text-align: center; }
  .nav-item svg { grid-column: 1 / -1; width: 1.2rem; height: 1.2rem; }
  .nav-item span { grid-column: 1 / -1; }
  .nav-item b { display: none; }
  .nav-item.active::before { inset: -6px auto auto; width: 25px; height: 3px; border-radius: 0 0 4px 4px; }
  .workspace { grid-row: 2; padding: .8rem .75rem calc(5.8rem + env(safe-area-inset-bottom)); }
  .player-card, .command-card, .library-card { border-radius: 17px; }
  .now-playing { align-items: flex-start; flex-direction: column; }
  .player-actions { justify-content: flex-start; width: 100%; }
  .action-button span { display: none; }
  .play-form { grid-template-columns: 1fr 1fr; }
  .input-shell { grid-column: 1 / -1; }
  .video-row { grid-template-columns: 112px minmax(0, 1fr); gap: .75rem; }
  .video-list.discovery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
  .video-row.video-card { display: flex; }
  .video-row.video-card .row-actions { grid-column: auto; border-top: 0; padding-top: 0; }
  .row-actions { grid-column: 1 / -1; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: .55rem; }
  footer { flex-direction: column; }
}

@media (max-width: 480px) {
  .empty-player img { width: 68px; height: 68px; }
  .empty-player p { display: none; }
  .privacy-pill { display: none; }
  .play-form { grid-template-columns: 1fr; }
  .input-shell { grid-column: 1; }
  .video-row { grid-template-columns: 94px minmax(0, 1fr); }
  .video-list.discovery-grid { grid-template-columns: 1fr; }
  .setting-row, .setting-row.stacked { align-items: flex-start; }
  .setting-row.stacked { flex-direction: column; }
  .button-row { width: 100%; }
  .button-row > * { flex: 1; }
  .engine-switch, .credential-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .nav-item.active, .primary-button, .privacy-pill { border: 2px solid ButtonText; }
}

#supportForm label { display:grid; gap:.45rem; color:var(--muted); }
#supportForm input, #supportForm select, #supportForm textarea { width:100%; box-sizing:border-box; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); color:var(--text); padding:.8rem; font:inherit; }
#supportStatus { min-height:1.4em; color:var(--blue-2); }

/* v1.2 — familiar, YouTube-shaped navigation while preserving JTS branding. */
:root {
  --header-height: 64px;
  --sidebar-width: 238px;
  --yt-surface: #0f0f0f;
  --yt-surface-2: #272727;
  --yt-hover: #272727;
}

html, body { background: #0f0f0f; }
body { background-image: none; }
.app-shell { grid-template: var(--header-height) 1fr / var(--sidebar-width) minmax(0, 1fr); }
.topbar {
  height: var(--header-height);
  padding: 0 1rem;
  border-bottom: 0;
  background: rgba(15, 15, 15, .98);
  gap: 1rem;
}
.topbar-start { display: flex; align-items: center; gap: .55rem; min-width: 218px; }
.menu-button { border: 0; border-radius: 999px; background: transparent; }
.menu-button:hover { background: var(--yt-hover); }
.brand { gap: .55rem; }
.brand img { width: 38px; height: 38px; border-radius: 9px; box-shadow: none; }
.brand strong { font-size: .92rem; }
.brand small { margin-top: .12rem; font-size: .64rem; letter-spacing: .12em; }
.top-search { flex: 1 1 720px; max-width: 720px; display: flex; align-items: center; gap: .75rem; margin-inline: auto; }
.search-field { min-width: 0; flex: 1; display: flex; height: 42px; }
.search-field input {
  min-width: 0;
  width: 100%;
  padding: 0 1rem;
  border: 1px solid #303030;
  border-radius: 999px 0 0 999px;
  outline: 0;
  background: #121212;
  color: #fff;
  font-size: 1rem;
}
.search-field input:focus { border-color: #1c62b9; box-shadow: inset 1px 0 #1c62b9; }
.search-submit {
  width: 64px;
  display: grid;
  place-items: center;
  border: 1px solid #303030;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  background: #222;
  cursor: pointer;
}
.search-submit:hover, .voice-button:hover { background: #333; }
.voice-button {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #272727;
  cursor: pointer;
}
.top-actions { min-width: 218px; justify-content: flex-end; }
.top-actions .icon-button { border: 0; border-radius: 999px; background: transparent; }
.account-button {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 38px;
  padding: .3rem .75rem .3rem .34rem;
  border: 1px solid #3f3f3f;
  border-radius: 999px;
  background: transparent;
  color: #3ea6ff;
  font-weight: 700;
  cursor: pointer;
}
.account-button:hover { border-color: #3ea6ff; background: rgba(62, 166, 255, .1); }
.account-avatar, .large-account-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, #188bff, #7b5cff);
  color: #fff;
  font-weight: 800;
}
.account-avatar { width: 28px; height: 28px; }
.account-avatar img, .large-account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.side-nav {
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  padding: .7rem .75rem 1.2rem;
  border-right: 0;
  background: #0f0f0f;
  overflow-y: auto;
}
.nav-item {
  min-height: 42px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  padding: .45rem .75rem;
  border: 0;
  border-radius: 10px;
  color: #f1f1f1;
  font-size: .9rem;
}
.nav-item:hover, .nav-item.active { background: #272727; }
.nav-item.active { font-weight: 700; }
.nav-item.active::before { display: none; }
.nav-divider { height: 1px; margin: .7rem .25rem; background: #303030; }
.nav-label { margin: .25rem .75rem .35rem; color: #fff; font-weight: 700; }
.workspace { width: 100%; max-width: 1800px; padding: .55rem clamp(.9rem, 2vw, 2rem) 2.5rem; }
.command-card, .library-card { border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
.feed-toolbar {
  position: sticky;
  z-index: 15;
  top: var(--header-height);
  padding: .3rem 0 .8rem;
  background: rgba(15, 15, 15, .98);
}
.category-strip { display: flex; flex-wrap: nowrap; gap: .72rem; padding: 0; overflow-x: auto; scrollbar-width: none; }
.category-strip::-webkit-scrollbar { display: none; }
.category-chip { flex: 0 0 auto; min-height: 34px; padding: .42rem .78rem; border: 0; border-radius: 8px; background: #272727; color: #f1f1f1; font-size: .88rem; }
.category-chip:hover { background: #3f3f3f; }
.category-chip.active { background: #f1f1f1; color: #0f0f0f; }
.toolbar-status { display: flex; align-items: center; gap: .7rem; min-height: 24px; margin-top: .45rem; }
.privacy-pill { min-height: 22px; padding: .18rem .5rem; border: 0; background: rgba(62, 166, 255, .12); color: #79c4ff; font-size: .68rem; }
.form-note { margin: 0; font-size: .72rem; opacity: .75; }
.library-card { padding: .2rem 0 2rem; }
.library-card > .section-heading { margin: .35rem 0 1rem; padding: 0; }
.section-heading .eyebrow { display: none; }
.library-card .section-heading h2 { font-size: 1.32rem; }
.video-list.discovery-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 2.2rem 1rem; }
.video-row.video-card { gap: .75rem; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.video-row.video-card:hover { transform: none; border: 0; background: transparent; }
.video-row.video-card .video-thumb { aspect-ratio: 16 / 9; border-radius: 12px; background: #222; }
.video-row.video-card .video-thumb img { transition: border-radius .15s ease; }
.video-row.video-card:hover .video-thumb img { border-radius: 0; }
.video-row.video-card .video-info { padding: 0 .15rem; }
.video-row.video-card .video-info strong { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #f1f1f1; font-size: .94rem; line-height: 1.35; }
.video-row.video-card .video-info small { margin-top: .4rem; color: #aaa; line-height: 1.4; }
.video-row.video-card .row-actions { position: absolute; top: calc(56.25% + .35rem); right: .15rem; opacity: 0; transition: opacity .15s ease; }
.video-row.video-card:hover .row-actions, .video-row.video-card:focus-within .row-actions { opacity: 1; }
.video-row.video-card .row-actions .icon-action { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #272727; }
.video-row { position: relative; }
.video-thumb::after {
  content: attr(data-duration);
  position: absolute;
  right: .35rem;
  bottom: .35rem;
  padding: .12rem .28rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, .82);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
}
.player-card { margin-bottom: 1rem; border-color: #303030; border-radius: 12px; background: #000; box-shadow: none; }
.now-playing { background: #0f0f0f; }
.channel-card { display: flex; align-items: center; gap: .9rem; min-height: 92px; padding: .75rem; border-radius: 12px; cursor: pointer; }
.channel-card:hover { background: #272727; }
.channel-card img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #272727; }
.channel-card strong, .channel-card small { display: block; }
.channel-card small { margin-top: .25rem; color: #aaa; }
.account-dialog .dialog-shell { max-width: 560px; }
.google-account-card { display: flex; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
.large-account-avatar { width: 56px; height: 56px; flex: 0 0 auto; font-size: 1.3rem; }
.google-account-card strong, .google-account-card small { display: block; }
.google-account-card small { margin-top: .3rem; color: var(--muted); line-height: 1.4; }
.account-notice { padding: .85rem; border-left: 3px solid #3ea6ff; background: rgba(62,166,255,.08); color: var(--muted); line-height: 1.5; font-size: .86rem; }
.account-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.account-summary > div { padding: .85rem; border-radius: 12px; background: #272727; text-align: center; }
.account-summary strong, .account-summary span { display: block; }
.account-summary strong { font-size: 1.35rem; }
.account-summary span { margin-top: .2rem; color: #aaa; font-size: .75rem; }
#googleAccountStatus { min-height: 1.35rem; color: #aaa; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.nav-collapsed .app-shell { grid-template-columns: 84px minmax(0, 1fr); }
.nav-collapsed .side-nav { padding-inline: .4rem; }
.nav-collapsed .side-nav .nav-item { grid-template-columns: 1fr; justify-items: center; min-height: 64px; font-size: .68rem; text-align: center; }
.nav-collapsed .side-nav .nav-item svg { width: 1.4rem; height: 1.4rem; }
.nav-collapsed .side-nav .nav-item b, .nav-collapsed .nav-divider, .nav-collapsed .nav-label { display: none; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 84px minmax(0, 1fr); }
  .side-nav { padding-inline: .4rem; }
  .side-nav .nav-item { grid-template-columns: 1fr; justify-items: center; min-height: 64px; font-size: .68rem; text-align: center; }
  .side-nav .nav-item svg { width: 1.4rem; height: 1.4rem; }
  .side-nav .nav-item b, .nav-divider, .nav-label { display: none; }
  .topbar-start, .top-actions { min-width: auto; }
  .network-state { display: none; }
}

@media (max-width: 760px) {
  :root { --header-height: 112px; }
  .app-shell { grid-template: var(--header-height) 1fr 64px / 1fr; }
  .topbar { align-content: center; display: grid; grid-template-columns: 1fr auto; grid-template-rows: 50px 52px; padding: .25rem .7rem; gap: 0 .4rem; }
  .topbar-start { grid-column: 1; grid-row: 1; }
  .menu-button { display: none; }
  .brand span { display: grid; }
  .top-actions { grid-column: 2; grid-row: 1; }
  .top-actions > .icon-button { display: none; }
  .account-button { padding-right: .35rem; border: 0; }
  #accountButtonText { display: none; }
  .top-search { grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: none; gap: .45rem; }
  .search-field { height: 40px; }
  .search-submit { width: 52px; }
  .voice-button { width: 40px; height: 40px; }
  .side-nav { position: fixed; z-index: 30; inset: auto 0 0; height: calc(64px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); padding: .25rem .3rem env(safe-area-inset-bottom); border-top: 1px solid #303030; background: rgba(15,15,15,.98); overflow: hidden; }
  .side-nav .nav-item { display: none; min-height: 56px; padding: .2rem; border-radius: 8px; }
  .side-nav .nav-item[data-view="home"], .side-nav .nav-item.mobile-primary { display: grid; }
  .side-nav .nav-item.mobile-primary:nth-of-type(n+5) { display: none; }
  .side-nav .nav-item svg { width: 1.22rem; height: 1.22rem; }
  .workspace { grid-row: 2; padding: .35rem .7rem calc(5rem + env(safe-area-inset-bottom)); }
  .feed-toolbar { top: var(--header-height); margin-inline: -.7rem; padding-inline: .7rem; }
  .video-list.discovery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem .65rem; }
  .video-row.video-card .row-actions { display: none; }
  .player-card { border-radius: 0; margin-inline: -.7rem; }
}

@media (max-width: 520px) {
  .brand strong { font-size: .8rem; }
  .brand small { font-size: .56rem; }
  .video-list.discovery-grid { grid-template-columns: 1fr; gap: 1.7rem; }
  .video-row.video-card .video-thumb { border-radius: 8px; }
  .account-summary { grid-template-columns: 1fr; }
}
