:root {
  color-scheme: dark;
  --bg: #101216;
  --panel: #171a20;
  --panel-soft: #1b1f26;
  --line: #282c34;
  --muted: #8d929e;
  --text: #eef0f4;
  --lime: #c4f268;
  --lime-ink: #1b2410;
  --blue: #8d9cff;
  --red: #ff777c;
  --font: "DM Sans", "Segoe UI", sans-serif;
  --display: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.app-shell { min-height: 100vh; display: flex; }

.sidebar { width: 246px; flex: 0 0 246px; min-height: 100vh; padding: 27px 16px 18px; border-right: 1px solid #24272e; background: #14161b; display: flex; flex-direction: column; }
.brand { height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 11px; color: var(--text); text-decoration: none; }
.brand-mark { width: 25px; height: 25px; display: flex; align-items: end; justify-content: center; gap: 3px; padding: 4px; border: 1px solid #495c32; border-radius: 8px; background: #252e1d; transform: rotate(-5deg); }
.brand-mark span { width: 3px; border-radius: 3px; background: var(--lime); transform: skewY(-17deg); }
.brand-mark span:nth-child(1) { height: 8px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 13px; }
.brand-mark span:nth-child(3) { height: 10px; opacity: .82; }
.brand-name { font: 800 21px var(--display); letter-spacing: -1.2px; }
.brand-dot { color: var(--lime); }
.sidebar-caption { color: #737986; font: 700 9px var(--display); letter-spacing: 1.3px; }
.sidebar > .sidebar-caption { padding: 36px 11px 11px; }
.side-nav { display: grid; gap: 4px; }
.nav-item { height: 42px; display: flex; align-items: center; gap: 11px; width: 100%; border: 0; border-radius: 8px; background: transparent; padding: 0 10px; color: #aeb2bc; text-align: left; transition: background .15s, color .15s; }
.nav-item:hover { background: #1b1e24; color: #eff1f4; }
.nav-item.active { background: #272c24; color: var(--lime); }
.nav-icon { width: 18px; color: currentColor; font-size: 17px; text-align: center; }
.nav-count { margin-left: auto; min-width: 21px; padding: 2px 6px; border-radius: 20px; background: #252830; color: #aeb3be; text-align: center; font-size: 10px; }
.nav-item.active .nav-count { background: #39452b; color: var(--lime); }
.sidebar-section-head { margin: 38px 10px 13px; display: flex; align-items: center; justify-content: space-between; }
.channel-count { color: #777d88; font-size: 11px; }
.channel-list { display: grid; gap: 5px; max-height: 36vh; overflow: auto; }
.channel-row { min-height: 39px; display: flex; align-items: center; gap: 9px; padding: 0 9px; color: #c2c5cd; border-radius: 7px; }
.channel-avatar { width: 23px; height: 23px; border: 1px solid #383d46; border-radius: 50%; display: grid; place-items: center; background: #242730; color: #c4f268; font-size: 9px; font-weight: 700; }
.channel-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.channel-empty { padding: 5px 10px; color: #727783; font-size: 11px; line-height: 1.5; }
.add-channel-side { margin: 10px 4px 0; padding: 9px 8px; border: 1px dashed #373c45; border-radius: 8px; color: #aeb3bc; background: transparent; text-align: left; font-size: 12px; }
.add-channel-side:hover { border-color: #727c61; color: var(--lime); }
.add-channel-side span { margin-right: 5px; font-size: 16px; vertical-align: -1px; }
.sidebar-bottom { margin-top: auto; }
.connection-card { display: flex; align-items: flex-start; gap: 9px; padding: 12px 10px; border: 1px solid #2a2d35; border-radius: 9px; background: #191c22; }
.connection-dot { margin-top: 4px; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #e2ae55; box-shadow: 0 0 0 3px #e2ae5520; }
.connection-dot.online { background: #9fe06b; box-shadow: 0 0 0 3px #9fe06b20; }
.connection-card strong { display: block; font-size: 11px; font-weight: 600; }
.connection-card span:not(.connection-dot) { display: block; margin-top: 3px; color: #828793; font-size: 10px; }
.sidebar-foot { padding: 14px 8px 0; color: #666b75; font-size: 10px; }

.main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 40px; border-bottom: 1px solid #252830; background: #13151a; }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #8a8f99; font-size: 11px; }
.breadcrumb strong { color: #e5e7eb; font-weight: 500; }
.crumb-sep { color: #4f535b; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.last-updated { color: #777d87; font-size: 10px; }
.refresh-button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 0; border-radius: 7px; background: var(--lime); color: var(--lime-ink); font-weight: 700; font-size: 11px; box-shadow: 0 3px 18px #c4f26812; transition: filter .15s, transform .15s; }
.refresh-button:hover { filter: brightness(1.07); transform: translateY(-1px); }
.refresh-button:disabled { opacity: .65; cursor: wait; transform: none; }
.refresh-icon { font-size: 16px; line-height: 1; }
.refresh-button.loading .refresh-icon { animation: rotate .9s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
.content { width: 100%; max-width: 1500px; margin: 0 auto; padding: 37px 40px 50px; flex: 1; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 25px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: #9aa0aa; font: 700 9px var(--display); letter-spacing: 1.65px; }
.eyebrow-line { display: inline-block; width: 19px; height: 2px; background: var(--lime); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font: 700 27px/1.2 var(--display); letter-spacing: -.8px; }
.page-subtitle { margin: 0; color: #8a8f9a; font-size: 12px; }
.heading-date { display: flex; align-items: center; gap: 7px; padding-bottom: 3px; color: #989da7; font-size: 11px; white-space: nowrap; }
.date-icon { color: #aeb3bd; font-size: 16px; }
.notice { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 11px 35px 11px 12px; margin: 0 0 17px; border: 1px solid #43402d; border-radius: 8px; background: #242319; color: #c4bf9c; font-size: 10px; line-height: 1.45; }
.notice-icon { width: 15px; height: 15px; flex: 0 0 auto; border: 1px solid #aaa16e; border-radius: 50%; color: #c5bd8c; font: 700 10px/14px var(--display); text-align: center; }
.notice-close { position: absolute; top: 7px; right: 10px; border: 0; background: transparent; color: #a09b7f; font-size: 18px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 12px; margin-bottom: 22px; }
.stat-card { min-height: 103px; padding: 15px 17px 12px; border: 1px solid #292d35; border-radius: 9px; background: #171a20; }
.stat-highlight { border-color: #3c4431; background: linear-gradient(115deg, #1a1f19, #191c20 68%); }
.stat-label { display: flex; align-items: center; justify-content: space-between; color: #898e98; font: 700 9px var(--display); letter-spacing: .6px; }
.stat-icon { color: #8b909a; font-size: 14px; }
.stat-highlight .stat-icon { color: var(--lime); }
.stat-value { margin-top: 10px; font: 700 24px var(--display); letter-spacing: -.5px; }
.stat-leader { overflow: hidden; max-width: 100%; color: var(--lime); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.stat-foot { margin-top: 4px; color: #777c86; font-size: 10px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 23px; padding: 11px 13px; border: 1px solid #292d35; border-radius: 8px; background: #171a20; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 17px; }
.filter-control { display: flex; align-items: center; gap: 9px; }
.filter-control label { color: #8e939d; font-size: 10px; white-space: nowrap; }
select, input[type="number"] { min-height: 29px; padding: 0 9px; border: 1px solid #343943; border-radius: 5px; background: #20232a; color: #e1e3e8; font-size: 10px; }
input[type="number"] { width: 70px; }
select { cursor: pointer; }
select option { background: #20232a; }
.toolbar-divider { height: 24px; width: 1px; background: #30343c; }
.result-count { color: #8e939c; font-size: 10px; }
.icon-button { width: 30px; height: 29px; border: 1px solid #353a44; border-radius: 5px; background: #20232a; color: #b7bbc4; font-size: 14px; }
.icon-button:hover { border-color: #6f7c52; color: var(--lime); }
.channel-manager { margin: -8px 0 25px; padding: 15px; border: 1px solid #343943; border-radius: 9px; background: #191c22; }
.manager-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.manager-heading strong { display: block; font: 700 13px var(--display); }
.manager-heading span { display: block; margin-top: 3px; color: #838893; font-size: 10px; }
.plain-button { border: 0; background: transparent; color: var(--lime); font-size: 10px; }
.add-channel-form { display: flex; align-items: center; gap: 9px; padding: 7px; border: 1px solid #363b45; border-radius: 7px; background: #13161b; }
.youtube-mark { display: grid; place-items: center; width: 25px; height: 19px; border-radius: 5px; background: #e5484d; color: white; font-size: 10px; }
.add-channel-form input { min-width: 0; flex: 1; border: 0; outline: none; background: transparent; color: var(--text); font-size: 11px; }
.add-channel-form input::placeholder { color: #666c77; }
.add-channel-form button { min-height: 30px; padding: 0 11px; border: 0; border-radius: 5px; background: #313a26; color: var(--lime); font-size: 10px; font-weight: 700; }
.add-channel-form button span { padding-left: 5px; font-size: 15px; vertical-align: -1px; }
.manager-channels { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.manager-chip { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid #343943; border-radius: 20px; background: #20232a; color: #c7cad1; font-size: 10px; }
.manager-chip button { border: 0; background: transparent; color: #818792; font-size: 15px; line-height: 12px; }
.manager-chip button:hover { color: var(--red); }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0 0 14px; }
.section-title-row h2 { margin: 0 0 4px; font: 700 15px var(--display); letter-spacing: -.3px; }
.section-title-row p { margin: 0; color: #818691; font-size: 10px; }
.view-switch { display: flex; gap: 3px; padding: 3px; border: 1px solid #292d35; border-radius: 6px; background: #171a20; }
.view-switch button { width: 25px; height: 23px; border: 0; border-radius: 4px; background: transparent; color: #737985; font-size: 13px; }
.view-switch button.view-switch-active { background: #343a2d; color: var(--lime); }
.video-grid, .saved-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.video-grid.list-mode { grid-template-columns: 1fr; }
.video-card { min-width: 0; overflow: hidden; border: 1px solid #2b2f37; border-radius: 9px; background: #181b21; transition: border-color .15s, transform .15s; }
.video-card:hover { border-color: #454b55; transform: translateY(-2px); }
.thumb-wrap { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #090b0f; }
.thumb-wrap img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.thumb-fallback { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; height: 100%; background: radial-gradient(circle at 68% 27%, #38432a, #242830 52%, #171a20); color: #77845f; font-size: 23px; }
.rank-badge { position: absolute; top: 9px; left: 9px; display: grid; place-items: center; min-width: 27px; height: 27px; padding: 0 6px; border: 1px solid #ffffff33; border-radius: 7px; background: #12151cdd; color: #fff; font: 800 11px var(--display); backdrop-filter: blur(6px); }
.rank-badge.top-rank { border-color: #c4f26888; background: #c4f268; color: #1b2410; }
.video-type { position: absolute; right: 9px; bottom: 9px; max-width: 72%; overflow: hidden; padding: 4px 6px; border-radius: 4px; background: #11151acc; color: #e5e6ea; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; backdrop-filter: blur(5px); }
.video-type.needs-check { background: #5b4824e8; color: #ffe2a0; }
.video-type.marked-short { background: #63353ae8; color: #ffc2c7; }
.video-type.marked-regular { background: #273a2ae8; color: #c4f2b2; }
.card-body { padding: 12px 12px 11px; }
.channel-line { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; color: #a4aab3; font-size: 9px; }
.channel-bullet { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.video-title { display: -webkit-box; overflow: hidden; min-height: 46px; margin: 0 0 8px; color: #e8eaf0; font: 600 16px/1.45 var(--display); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.video-meta { display: flex; align-items: center; gap: 9px; color: #888e98; font-size: 11px; }
.video-meta .meta-views { color: var(--lime); font-size: 13px; font-weight: 700; }
.video-card .video-meta .meta-views { font-size: 14px; }
.views-average { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; color: #8e95a0; font-size: 10px; line-height: 1.4; }
.views-average strong { color: #b5bbc5; font-weight: 600; }
.meta-dot { width: 2px; height: 2px; border-radius: 50%; background: #646a74; }
.format-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 9px; color: #818691; font-size: 9px; }
.format-button { min-height: 24px; padding: 0 8px; border: 1px solid #383d46; border-radius: 5px; background: #20232a; color: #b8bdc6; font-size: 9px; }
.format-button:hover { border-color: #747d5d; color: #e9ecdf; }
.format-button.is-short.selected { border-color: #795055; background: #362428; color: #ffc2c7; }
.format-button.is-regular.selected { border-color: #536a45; background: #283323; color: #c4f2b2; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 11px; padding-top: 9px; border-top: 1px solid #2a2e36; }
.views-daily { color: #9399a3; font-size: 9px; }
.save-button { min-height: 34px; padding: 0 12px; border: 1px solid #475239; border-radius: 5px; background: #293222; color: var(--lime); font-size: 12px; font-weight: 700; }
.save-button:hover { background: #37442c; }
.save-button.saved { border-color: #353941; background: #23262d; color: #858b95; }
.video-grid.list-mode .video-card { display: grid; grid-template-columns: 220px 1fr; }
.video-grid.list-mode .thumb-wrap { height: 100%; min-height: 145px; aspect-ratio: auto; }
.video-grid.list-mode .card-body { display: flex; flex-direction: column; justify-content: center; padding: 13px 16px; }
.video-grid.list-mode .video-title { min-height: auto; }
.video-grid.list-mode .card-footer { margin-top: auto; }
.video-grid.list-mode .video-meta { font-size: 10px; }
.section-counter { padding: 6px 9px; border: 1px solid #333842; border-radius: 18px; color: #aeb3bc; font-size: 10px; }
.saved-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid #2b2f37; border-radius: 9px; background: #181b21; }
.saved-card .thumb-wrap { aspect-ratio: 16 / 8.5; }
.saved-card .card-body { display: flex; flex: 1; flex-direction: column; }
.saved-card .saved-note { width: 100%; min-height: 57px; resize: vertical; margin-top: 3px; padding: 8px; border: 1px solid #333842; border-radius: 6px; background: #13161b; color: #d3d6dc; font-size: 10px; line-height: 1.45; }
.saved-card .saved-note::placeholder { color: #717782; }
.saved-card .card-footer { margin-top: 9px; }
.saved-date { color: #767c87; font-size: 9px; }
.archive-label { color: #a5b88c; font-size: 9px; }
.saved-actions { display: flex; gap: 6px; }
.saved-actions button { min-height: 27px; padding: 0 8px; border: 1px solid #41464f; border-radius: 5px; background: #24272e; color: #c1c5cd; font-size: 9px; }
.saved-actions button:hover { border-color: #707a5b; color: var(--lime); }
.saved-actions .delete-idea:hover { border-color: #8d474b; color: #ff9b9f; }
.empty-state { display: none; min-height: 280px; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; border: 1px dashed #343943; border-radius: 10px; background: #15181e; text-align: center; }
.empty-state.visible { display: flex; }
.empty-art { position: relative; width: 108px; height: 87px; display: grid; place-items: center; margin-bottom: 13px; }
.empty-orbit { position: absolute; border: 1px solid #47523a; border-radius: 50%; transform: rotate(-20deg); }
.orbit-one { width: 82px; height: 48px; }
.orbit-two { width: 54px; height: 77px; transform: rotate(48deg); border-color: #343d32; }
.empty-play, .empty-gem { position: relative; display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid #66754e; border-radius: 10px; background: #273122; color: var(--lime); font-size: 12px; }
.empty-gem { font-size: 20px; }
.empty-state h3 { margin: 0 0 6px; font: 700 14px var(--display); }
.empty-state p { max-width: 360px; margin: 0; color: #858b95; font-size: 10px; line-height: 1.55; }
.empty-action { margin-top: 16px; min-height: 32px; }
.compact-empty { min-height: 250px; }
.small-art { height: 67px; margin-bottom: 11px; transform: scale(.8); }
.progress-wrap { margin-bottom: 13px; }
.progress-copy { display: flex; justify-content: space-between; margin-bottom: 6px; color: #9ca1aa; font-size: 10px; }
.progress-track { height: 4px; overflow: hidden; border-radius: 4px; background: #292d35; }
.progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--lime); transition: width .2s; }
.toast { position: fixed; z-index: 5; right: 23px; bottom: 22px; max-width: min(420px, calc(100vw - 40px)); padding: 12px 15px; border: 1px solid #41464f; border-radius: 8px; background: #23272e; color: #e7e9ed; box-shadow: 0 8px 30px #0005; font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: #81454b; }
.page-footer { display: flex; justify-content: space-between; gap: 15px; padding: 13px 40px 18px; border-top: 1px solid #252830; color: #686e78; font-size: 9px; letter-spacing: .3px; }
.page-footer span:first-child { color: #7a808b; font-weight: 700; letter-spacing: 1px; }

@media (max-width: 1100px) {
  .sidebar { width: 215px; flex-basis: 215px; }
  .content { padding-right: 26px; padding-left: 26px; }
  .topbar { padding: 0 26px; }
  .video-grid, .saved-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app-shell { display: block; padding-bottom: 60px; }
  .sidebar { position: fixed; z-index: 4; inset: auto 0 0; width: 100%; min-height: 0; height: 58px; padding: 5px 10px; border-top: 1px solid #2d3038; border-right: 0; background: #15171c; }
  .brand, .sidebar-caption, .sidebar-section-head, .channel-list, .add-channel-side, .sidebar-bottom { display: none; }
  .side-nav { display: flex; justify-content: space-around; gap: 5px; }
  .nav-item { height: 47px; max-width: 150px; flex: 1; flex-direction: column; justify-content: center; gap: 1px; padding: 3px; font-size: 9px; }
  .nav-icon { width: auto; font-size: 15px; }
  .nav-count { position: absolute; margin: -25px 0 0 30px; min-width: 16px; padding: 1px 4px; font-size: 8px; }
  .topbar { min-height: 57px; padding: 0 16px; }
  .breadcrumb span:first-child, .crumb-sep, .last-updated { display: none; }
  .topbar-actions { gap: 0; }
  .refresh-button { min-height: 33px; padding: 0 10px; font-size: 10px; }
  .content { padding: 25px 16px 30px; }
  .page-heading { align-items: flex-start; margin-bottom: 17px; }
  h1 { font-size: 21px; }
  .page-subtitle { max-width: 290px; font-size: 10px; line-height: 1.45; }
  .heading-date { display: none; }
  .notice { font-size: 9px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
  .stat-card { min-height: 91px; padding: 12px; }
  .stat-highlight { grid-column: 1 / -1; min-height: 82px; }
  .stat-label { font-size: 8px; }
  .stat-value { font-size: 21px; }
  .stat-leader { font-size: 14px; }
  .toolbar { align-items: flex-start; flex-direction: column; gap: 10px; padding: 10px; }
  .toolbar-left { width: 100%; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
  .filter-control { align-items: flex-start; flex-direction: column; gap: 5px; }
  .toolbar-divider { display: none; }
  .filter-control select { max-width: 150px; }
  .toolbar-right { width: 100%; justify-content: flex-end; }
  .section-title-row h2 { font-size: 14px; }
  .section-title-row p { max-width: 260px; line-height: 1.45; }
  .video-grid, .saved-grid { grid-template-columns: 1fr; gap: 10px; }
  .video-grid.list-mode .video-card { grid-template-columns: 120px 1fr; }
  .video-grid.list-mode .thumb-wrap { min-height: 100px; }
  .video-grid.list-mode .card-body { padding: 9px; }
  .video-grid.list-mode .video-title { font-size: 13px; min-height: 38px; }
  .video-grid.list-mode .video-meta { gap: 5px; font-size: 10px; }
  .video-grid.list-mode .card-footer { margin-top: 8px; }
  .video-grid.list-mode .views-daily { display: none; }
  .page-footer { padding: 12px 16px 18px; font-size: 8px; }
  .page-footer span:last-child { max-width: 145px; text-align: right; }
}
