:root{color-scheme:dark;--bg:#0e0e10;--panel:#17171a;--panel2:#1c1c20;--line:#2b2b31;--text:#f2f2f4;--muted:#8a8a94;--danger:#ff7379}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font:14px/1.35 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}button,input{font:inherit}button{cursor:pointer}
.topbar{height:58px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:18px;padding:0 18px;border-bottom:1px solid var(--line);background:#111114;position:sticky;top:0;z-index:30}
.brand{display:flex;align-items:center;gap:8px;color:#fff;text-decoration:none}.brand-mark{display:inline-flex;align-items:center;justify-content:center;width:28px;height:20px;border-radius:6px;background:#ff1744;font-size:10px}.title-wrap{display:flex;align-items:baseline;gap:8px}.title-wrap>span{color:var(--muted);font-size:11px}.top-actions{display:flex;align-items:center;gap:7px}
.ghost,.secondary,.primary,.danger,.icon-btn{height:34px;padding:0 12px;border-radius:8px;border:1px solid #393940}.ghost,.secondary,.icon-btn{background:#202024;color:#ddd}.primary{background:#f4f4f5;color:#111;border-color:#f4f4f5;font-weight:750}.danger{background:#251719;color:#ff858b;border-color:#583137;font-weight:700}.icon-btn{width:34px;padding:0;display:grid;place-items:center}.icon-btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
main{padding-bottom:40px}.source-manager-head{position:sticky;top:58px;z-index:25;background:#131316;border-bottom:1px solid var(--line)}.source-manager-title{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 18px 8px}.source-manager-title strong{display:block;font-size:16px}.source-manager-title span{display:block;color:var(--muted);font-size:11px;margin-top:3px}
.scope-row{display:flex;gap:6px;overflow-x:auto;padding:0 18px 10px;scrollbar-width:none}.scope-row::-webkit-scrollbar{display:none}.scope-chip-wrap{display:flex;align-items:center;gap:3px;flex:0 0 auto}.scope-chip{height:32px;padding:0 11px;border:1px solid #303038;border-radius:8px;background:#1c1c20;color:#aaa}.scope-chip.active{background:#f3f3f4;color:#111;border-color:#f3f3f4;font-weight:750}.scope-chip span{margin-left:4px;color:#777;font-size:10px}.scope-edit{width:26px;height:26px;border:0;border-radius:7px;background:transparent;color:#6f6f78;font-size:16px}.scope-edit:hover{background:#242429;color:#ddd}
.workspace{display:grid;grid-template-columns:repeat(3,minmax(215px,.8fr)) minmax(300px,1.25fr);gap:10px;padding:12px 14px 14px;min-height:420px}.column{min-width:0;display:flex;flex-direction:column;border:1px solid var(--line);border-radius:10px;background:var(--panel);overflow:hidden}.column-head{min-height:44px;display:flex;align-items:center;justify-content:space-between;padding:0 11px;border-bottom:1px solid var(--line);background:#1b1b1f}.column-head>div:first-child{display:flex;align-items:center;gap:7px}.column-head strong{font-size:12px}.column-head span{color:#777;font-size:10px}.search-head{align-items:center}.search-mode{display:flex;gap:3px}.search-mode-btn{height:26px;padding:0 8px;border:1px solid #34343a;border-radius:6px;background:#222226;color:#888;font-size:10px}.search-mode-btn.active{background:#3a3a40;color:#fff}
.channel-list{min-height:0;max-height:470px;overflow:auto;padding:2px 6px 8px}.channel-card{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:54px;padding:6px 3px;border-bottom:1px solid #26262b}.channel-card:hover{background:#1c1c20}.channel-avatar{width:32px;height:32px;border-radius:50%;overflow:hidden;background:#2b2b31;display:grid;place-items:center;color:#aaa;font-size:12px;font-weight:700}.channel-avatar img{width:100%;height:100%;object-fit:cover}.channel-copy{min-width:0;border:0;background:transparent;color:inherit;text-align:left;padding:0}.channel-copy strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11.5px}.channel-copy span{display:block;margin-top:2px;color:#777;font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card-actions{display:flex;gap:4px;align-items:center}.tiny{height:27px;padding:0 7px;border:1px solid #3a3a41;border-radius:6px;background:#232327;color:#ddd;font-size:9.5px}.tiny.primary{background:#f3f3f4;color:#111;border-color:#f3f3f4;font-weight:700}.tiny.danger{background:#251719;color:#ff858b;border-color:#563036}.empty{padding:20px 8px;color:#777;font-size:11px;text-align:center}
.search-box{display:grid;grid-template-columns:minmax(0,1fr) auto;margin:8px;border:1px solid #35353b;border-radius:8px;overflow:hidden}.search-box input{height:36px;border:0;outline:0;background:#121214;color:#fff;padding:0 9px}.search-box button{width:46px;border:0;border-left:1px solid #35353b;background:#242428;color:#fff}.status{min-height:22px;padding:0 9px 5px;color:#74747d;font-size:10px}
.search-result{padding:7px 3px}.search-result.video{grid-template-columns:70px minmax(0,1fr) auto}.search-thumb{width:66px;aspect-ratio:16/9;object-fit:cover;border-radius:6px;background:#000}.other-sources{grid-column:1/-1;display:none;gap:4px;flex-wrap:wrap;padding:5px 0 2px 42px}.search-result.video .other-sources{padding-left:78px}.channel-card.show-other .other-sources{display:flex}.source-mini-chip{height:25px;padding:0 7px;border:1px solid #35353b;border-radius:6px;background:#1f1f23;color:#aaa;font-size:9px}.source-mini-chip.active{background:#f3f3f4;color:#111;border-color:#f3f3f4}
.preview{margin:0 14px 14px;border:1px solid var(--line);border-radius:12px;background:#151518;overflow:hidden}.preview[hidden]{display:none}.preview-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px;border-bottom:1px solid var(--line)}.preview-identity{display:flex;align-items:center;gap:10px;min-width:0}.preview-avatar{width:42px;height:42px;border-radius:50%;overflow:hidden;background:#29292f;display:grid;place-items:center}.preview-avatar img{width:100%;height:100%;object-fit:cover}.preview-identity strong{display:block;font-size:15px}.preview-identity span{display:block;margin-top:3px;color:#85858e;font-size:10.5px}.preview-actions{display:flex;gap:6px}.preview-assign{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px;padding:8px 14px;border-bottom:1px solid var(--line)}.preview-assign>span{color:#75757e;font-size:9.5px;font-weight:700;text-transform:uppercase}.scope-assign-row{display:flex;gap:5px;overflow-x:auto}.assign-chip{flex:0 0 auto;height:27px;padding:0 8px;border:1px solid #35353b;border-radius:6px;background:#1e1e22;color:#aaa;font-size:9.5px}.assign-chip.active{background:#f3f3f4;color:#111;border-color:#f3f3f4}.assign-chip.blocked{color:#ff858b;border-color:#553036}
.preview-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px}.preview-toolbar form{width:min(330px,45%)}.preview-toolbar input{width:100%;height:34px;border:1px solid #34343a;border-radius:7px;background:#111114;color:#fff;padding:0 9px;outline:0}.video-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;padding:0 14px 14px}.video-card{border:1px solid #2d2d33;border-radius:9px;overflow:hidden;background:#1a1a1d;cursor:pointer;transition:.12s}.video-card:hover{border-color:#4a4a51;transform:translateY(-1px)}.video-thumb{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;background:#000}.video-copy{padding:7px}.video-copy strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:10.5px}.video-copy span{display:block;margin-top:4px;color:#777;font-size:9px}
.filters-panel{position:fixed;inset:58px 0 0 auto;z-index:40;width:min(520px,100vw);background:#151518;border-left:1px solid var(--line);box-shadow:-16px 0 50px rgba(0,0,0,.35);padding:14px;overflow:auto}.filters-panel[hidden]{display:none}.filters-head{display:flex;align-items:center;justify-content:space-between;padding-bottom:12px;border-bottom:1px solid var(--line)}.filters-head strong{display:block}.filters-head span{display:block;color:#777;font-size:10px;margin-top:2px}.filters-grid{display:grid;gap:12px;padding-top:12px}.filter-card{border:1px solid var(--line);border-radius:9px;background:#1a1a1d;padding:12px}.filter-card>strong{display:block}.filter-card>span{display:block;color:#777;font-size:10px;margin:4px 0 10px}.filter-entry{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}.filter-entry input{height:34px;border:1px solid #36363c;border-radius:7px;background:#111114;color:#fff;padding:0 9px}.filter-entry button{border:0;border-radius:7px;background:#f2f2f3;color:#111;font-weight:700}.keyword-chips{display:flex;flex-wrap:wrap;gap:5px;margin-top:9px}.keyword-chip{height:26px;border:1px solid #38383f;border-radius:999px;background:#202024;color:#ddd;padding:0 8px;font-size:9.5px}
.source-edit-popover{position:fixed;inset:0;z-index:60;display:grid;place-items:center;background:rgba(0,0,0,.5)}.source-edit-popover[hidden]{display:none}.source-edit-card{width:min(320px,calc(100vw - 30px));display:grid;gap:8px;padding:14px;border:1px solid #35353b;border-radius:10px;background:#1a1a1d}.source-edit-card strong{margin-bottom:3px}.source-edit-card button{width:100%}
.auth{position:fixed;inset:0;z-index:80;display:grid;place-items:center;background:rgba(0,0,0,.72)}.auth[hidden]{display:none}.auth-card{width:min(340px,calc(100vw - 30px));padding:18px;border:1px solid #34343a;border-radius:12px;background:#1a1a1d}.auth-card strong,.auth-card span{display:block}.auth-card span{color:#888;font-size:11px;margin:4px 0 10px}.auth-card input{width:100%;height:42px;border:1px solid #3b3b42;border-radius:8px;background:#111114;color:#fff;padding:0 10px;margin-bottom:7px}.auth-card button{width:100%;margin-top:7px}.auth-error{min-height:18px;color:#ff7b81;font-size:11px}
@media(max-width:1180px){.workspace{grid-template-columns:repeat(4,minmax(250px,1fr));overflow-x:auto}.column{min-width:250px}.video-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:760px){.topbar{padding:0 10px}.title-wrap>span{display:none}.source-manager-title{padding:10px}.scope-row{padding:0 10px 9px}.workspace{padding:9px 10px;grid-template-columns:repeat(4,minmax(270px,1fr));min-height:390px}.preview{margin:0 10px 10px}.preview-head{align-items:flex-start}.preview-actions{flex-wrap:wrap;justify-content:flex-end}.preview-assign{grid-template-columns:1fr}.video-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 10px 10px}.preview-toolbar{padding:9px 10px}.preview-toolbar form{width:50%}}


/* v4: column 4 owns search, channel preview and inline playback */
.search-column{
  overflow:hidden;
}
.search-column .search-results{
  flex:0 1 auto;
  max-height:470px;
}
.search-column.has-preview .search-results{
  max-height:190px;
  border-bottom:1px solid var(--line);
}
.column-preview{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  border-top:1px solid var(--line);
  background:#151518;
}
.column-preview[hidden]{display:none}
.column-preview .preview-head{
  position:sticky;
  top:0;
  z-index:5;
  background:#17171a;
  padding:9px 8px;
}
.column-preview .preview-identity{
  min-width:0;
}
.column-preview .preview-avatar{
  width:34px;
  height:34px;
  flex:0 0 auto;
}
.column-preview .preview-identity strong{
  max-width:220px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:12px;
}
.column-preview .preview-actions{
  gap:4px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.column-preview .preview-assign{
  display:block;
  padding:7px 8px;
}
.column-preview .preview-assign>span{
  display:block;
  margin-bottom:5px;
}
.column-preview .scope-assign-row{
  padding-bottom:1px;
}
.column-preview .preview-toolbar{
  display:block;
  padding:8px;
}
.column-preview .preview-toolbar strong{
  display:block;
  margin-bottom:6px;
  font-size:11px;
}
.column-preview .preview-toolbar form{
  width:100%;
}
.column-preview .preview-toolbar input{
  width:100%;
  height:31px;
  font-size:10.5px;
}
.column-video-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:7px!important;
  padding:0 8px 10px!important;
}
.column-video-grid .video-copy{
  padding:6px;
}
.column-video-grid .video-copy strong{
  font-size:9.8px;
}
.inline-player{
  padding:8px;
  border-bottom:1px solid var(--line);
  background:#101012;
}
.inline-player[hidden]{display:none}
.inline-player-head{
  min-height:29px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:6px;
}
.inline-player-head strong{
  min-width:0;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  font-size:10.5px;
}
.inline-player-frame{
  position:relative;
  width:100%;
  aspect-ratio:16/9;
  overflow:hidden;
  border-radius:8px;
  background:#000;
}
.inline-player-frame iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
  background:#000;
}
.search-result .card-actions{
  flex-wrap:wrap;
  justify-content:flex-end;
}
.search-column .channel-card{
  min-height:50px;
}
.search-column .search-result.video{
  min-height:64px;
}
.search-column .search-result.video .search-thumb{
  width:62px;
}
.search-column .search-result.video{
  grid-template-columns:66px minmax(0,1fr) auto;
}
.search-column .search-result.video .other-sources{
  padding-left:70px;
}

@media(max-width:1180px){
  .search-column{
    min-width:330px!important;
  }
}
@media(max-width:760px){
  .search-column{
    min-width:330px!important;
  }
  .column-video-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}


/* v5 compact status columns; reserve width for search/preview column */
.workspace{
  grid-template-columns:
    minmax(175px,.62fr)
    minmax(190px,.68fr)
    minmax(190px,.68fr)
    minmax(360px,1.6fr);
  align-items:stretch;
}
.column[data-column="suggested"],
.column[data-column="selected"],
.column[data-column="blocked"]{
  min-width:0;
}
.column[data-column="suggested"] .channel-card,
.column[data-column="selected"] .channel-card,
.column[data-column="blocked"] .channel-card{
  grid-template-columns:30px minmax(0,1fr) auto;
  gap:6px;
  min-height:48px;
  padding:5px 2px;
}
.column[data-column="suggested"] .channel-avatar,
.column[data-column="selected"] .channel-avatar,
.column[data-column="blocked"] .channel-avatar{
  width:28px;
  height:28px;
}
.column[data-column="suggested"] .channel-copy strong,
.column[data-column="selected"] .channel-copy strong,
.column[data-column="blocked"] .channel-copy strong{
  max-width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:10.8px;
}
.column[data-column="suggested"] .channel-copy span,
.column[data-column="selected"] .channel-copy span,
.column[data-column="blocked"] .channel-copy span{
  font-size:8.8px;
}
.column[data-column="suggested"] .card-actions,
.column[data-column="selected"] .card-actions,
.column[data-column="blocked"] .card-actions{
  gap:3px;
  flex-wrap:nowrap;
}
.column[data-column="suggested"] .tiny,
.column[data-column="selected"] .tiny,
.column[data-column="blocked"] .tiny{
  height:24px;
  padding:0 6px;
  font-size:8.8px;
  white-space:nowrap;
}
.column[data-column="suggested"] .channel-list,
.column[data-column="selected"] .channel-list,
.column[data-column="blocked"] .channel-list{
  max-height:520px;
}
.search-column{
  min-width:360px;
}

@media(max-width:1180px){
  .workspace{
    grid-template-columns:
      minmax(180px,220px)
      minmax(190px,230px)
      minmax(190px,230px)
      minmax(360px,1fr);
  }
}


/* v6 density + single-purpose fourth column */
.workspace{
  grid-template-columns:
    minmax(165px,.56fr)
    minmax(175px,.60fr)
    minmax(185px,.64fr)
    minmax(420px,1.8fr);
  gap:8px;
  padding:10px 12px 12px;
}
.column{
  border-radius:9px;
}
.column-head{
  min-height:38px;
  padding:0 9px;
}
.column-head strong{font-size:11px}
.column-head span{font-size:9px}

.column[data-column="suggested"] .channel-card,
.column[data-column="selected"] .channel-card,
.column[data-column="blocked"] .channel-card{
  grid-template-columns:28px minmax(0,1fr) auto;
  min-height:44px;
  padding:4px 2px;
  gap:5px;
}
.column[data-column="suggested"] .channel-avatar,
.column[data-column="selected"] .channel-avatar,
.column[data-column="blocked"] .channel-avatar{
  width:26px;
  height:26px;
}
.column[data-column="suggested"] .channel-copy strong,
.column[data-column="selected"] .channel-copy strong,
.column[data-column="blocked"] .channel-copy strong{
  font-size:10.2px;
}
.column[data-column="suggested"] .channel-copy span,
.column[data-column="selected"] .channel-copy span,
.column[data-column="blocked"] .channel-copy span{
  display:none;
}
.column[data-column="suggested"] .tiny,
.column[data-column="selected"] .tiny,
.column[data-column="blocked"] .tiny{
  height:22px;
  padding:0 5px;
  font-size:8.2px;
  border-radius:5px;
}
.column[data-column="suggested"] .channel-list,
.column[data-column="selected"] .channel-list,
.column[data-column="blocked"] .channel-list{
  max-height:560px;
  padding-inline:5px;
}

/* One fixed search area, then content starts immediately below it. */
.search-column{
  min-width:420px;
}
.search-column .search-head{
  min-height:38px;
}
.search-column .search-box{
  margin:7px 8px 5px;
}
.search-column .search-box input{
  height:34px;
}
.search-column .status{
  min-height:18px;
  padding:0 8px 4px;
}
.search-column.has-preview .search-results,
.search-column.has-preview .status{
  display:none!important;
}
.search-column.has-preview .column-preview{
  border-top:0;
}
.column-preview .preview-head{
  padding:8px;
  border-top:1px solid var(--line);
}
.column-preview .preview-assign{
  padding:6px 8px;
}
.column-preview .preview-toolbar{
  padding:7px 8px 5px;
}
.column-preview .preview-toolbar strong{
  margin:0;
  font-size:10.8px;
}
.column-video-grid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:6px!important;
  padding:0 8px 9px!important;
}
.column-video-grid .video-copy strong{
  font-size:9.4px;
}
.inline-player{
  padding:7px 8px 8px;
}
.inline-player-head{
  min-height:26px;
  margin-bottom:5px;
}

@media(max-width:1280px){
  .workspace{
    grid-template-columns:
      minmax(170px,195px)
      minmax(180px,205px)
      minmax(190px,215px)
      minmax(410px,1fr);
  }
}
@media(max-width:980px){
  .workspace{
    grid-template-columns:repeat(4,minmax(250px,1fr));
    overflow-x:auto;
  }
  .search-column{min-width:360px}
}


/* v7 full-height professional source manager */
html,body{
  width:100%;
  height:100%;
  min-height:0;
  overflow:hidden;
}
body{
  display:grid;
  grid-template-rows:52px minmax(0,1fr);
}
.topbar{
  position:relative;
  top:auto;
  height:52px;
  min-height:52px;
  padding:0 14px;
}
main{
  min-height:0;
  height:auto;
  padding:0;
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  overflow:hidden;
}

/* Compact source selector: no wasted descriptive block above the workspace. */
.source-manager-head{
  position:relative;
  top:auto;
  z-index:10;
  min-height:0;
  background:#131316;
}
.source-manager-title{
  min-height:36px;
  padding:6px 14px 2px;
}
.source-manager-title>div{
  display:flex;
  align-items:baseline;
  gap:8px;
  min-width:0;
}
.source-manager-title strong{
  font-size:13px;
}
.source-manager-title span{
  margin:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:9.5px;
}
.source-manager-title .primary{
  height:29px;
  padding:0 10px;
  font-size:10px;
}
.scope-row{
  padding:2px 14px 7px;
  gap:4px;
}
.scope-chip-wrap{
  gap:2px;
}
.scope-chip{
  height:28px;
  max-width:126px;
  padding:0 9px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  font-size:10px;
}
.scope-edit{
  width:18px;
  height:24px;
  font-size:13px;
  border-radius:5px;
}

/* One viewport-high dashboard. Columns 1–3 stay intentionally narrow. */
.workspace{
  min-height:0;
  height:100%;
  overflow:hidden;
  display:grid;
  grid-template-columns:185px 195px 205px minmax(0,1fr);
  gap:7px;
  padding:7px 10px 9px;
  align-items:stretch;
}
.column{
  min-height:0;
  height:100%;
  overflow:hidden;
  border-radius:8px;
}
.column-head{
  flex:0 0 34px;
  min-height:34px;
  height:34px;
  padding:0 7px;
}
.column-head strong{font-size:10.5px}
.column-head span{font-size:8.5px}

/* These three lists must consume every remaining pixel and own their scroll. */
.column[data-column="suggested"] .channel-list,
.column[data-column="selected"] .channel-list,
.column[data-column="blocked"] .channel-list{
  flex:1 1 auto;
  min-height:0;
  max-height:none!important;
  height:auto;
  overflow-y:auto;
  overflow-x:hidden;
  padding:1px 4px 6px;
}
.column[data-column="suggested"] .channel-card,
.column[data-column="selected"] .channel-card,
.column[data-column="blocked"] .channel-card{
  grid-template-columns:25px minmax(0,1fr) auto;
  min-height:39px;
  height:39px;
  padding:3px 1px;
  gap:4px;
}
.column[data-column="suggested"] .channel-avatar,
.column[data-column="selected"] .channel-avatar,
.column[data-column="blocked"] .channel-avatar{
  width:24px;
  height:24px;
}
.column[data-column="suggested"] .channel-copy,
.column[data-column="selected"] .channel-copy,
.column[data-column="blocked"] .channel-copy{
  width:100%;
  overflow:hidden;
}
.column[data-column="suggested"] .channel-copy strong,
.column[data-column="selected"] .channel-copy strong,
.column[data-column="blocked"] .channel-copy strong{
  display:block;
  width:100%;
  max-width:100%;
  font-size:9.7px;
  font-weight:650;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.column[data-column="suggested"] .channel-copy span,
.column[data-column="selected"] .channel-copy span,
.column[data-column="blocked"] .channel-copy span{
  display:none!important;
}
.column[data-column="suggested"] .card-actions,
.column[data-column="selected"] .card-actions,
.column[data-column="blocked"] .card-actions{
  gap:2px;
}
.column[data-column="suggested"] .tiny,
.column[data-column="selected"] .tiny,
.column[data-column="blocked"] .tiny{
  height:20px;
  padding:0 4px;
  font-size:7.8px;
  border-radius:4px;
}

/* Column 4 receives all flexible width and manages its own vertical space. */
.search-column{
  min-width:0!important;
  height:100%;
}
.search-column .search-head{
  flex:0 0 34px;
  height:34px;
  min-height:34px;
}
.search-mode-btn{
  height:23px;
  padding:0 7px;
  font-size:9px;
}
.search-column .search-box{
  flex:0 0 34px;
  height:34px;
  margin:5px 7px 3px;
}
.search-column .search-box input{
  height:32px;
  font-size:10.5px;
}
.search-column .search-box button{
  width:43px;
  font-size:10px;
}
.search-column .status{
  flex:0 0 auto;
  min-height:15px;
  padding:0 7px 2px;
}

/* Search results scroll only when no channel is open. */
.search-column .search-results{
  flex:1 1 auto;
  min-height:0;
  max-height:none!important;
  overflow-y:auto;
}
.search-column.has-preview .search-results,
.search-column.has-preview .status{
  display:none!important;
}

/* Preview starts directly below the one search box and fills the rest. */
.column-preview{
  flex:1 1 auto;
  min-height:0;
  height:auto;
  overflow-y:auto;
  overflow-x:hidden;
  border-top:1px solid var(--line);
}
.column-preview .preview-head{
  position:relative;
  top:auto;
  padding:6px 7px;
  min-height:42px;
}
.column-preview .preview-avatar{
  width:30px;
  height:30px;
}
.column-preview .preview-identity{
  gap:6px;
}
.column-preview .preview-identity strong{
  max-width:210px;
  font-size:10.8px;
}
.column-preview .preview-identity span{
  font-size:8.8px;
  margin-top:1px;
}
.column-preview .preview-actions{
  gap:3px;
}
.column-preview .preview-actions .tiny{
  height:23px;
  padding:0 6px;
  font-size:8px;
}
.column-preview .preview-assign{
  padding:4px 7px 5px;
}
.column-preview .preview-assign>span{
  margin-bottom:3px;
  font-size:8px;
}
.assign-chip{
  height:23px;
  padding:0 6px;
  font-size:8px;
}

/* Player must not consume the whole fourth column. */
.inline-player{
  padding:5px 7px 7px;
}
.inline-player-head{
  min-height:22px;
  margin-bottom:4px;
}
.inline-player-head strong{
  font-size:9.5px;
}
.inline-player-frame{
  width:min(100%,540px);
  aspect-ratio:16/9;
  margin:0 auto;
  border-radius:7px;
}
.column-preview .preview-toolbar{
  padding:5px 7px 4px;
}
.column-preview .preview-toolbar strong{
  font-size:10px;
}
.column-video-grid{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:5px!important;
  padding:0 7px 8px!important;
}
.column-video-grid .video-copy{
  padding:5px;
}
.column-video-grid .video-copy strong{
  -webkit-line-clamp:2;
  font-size:8.9px;
  line-height:1.25;
}
.column-video-grid .video-copy span{
  margin-top:2px;
  font-size:8px;
}

/* Clean, narrow scrollbars instead of stopping halfway visually. */
.channel-list,
.column-preview{
  scrollbar-width:thin;
  scrollbar-color:#46464d transparent;
}
.channel-list::-webkit-scrollbar,
.column-preview::-webkit-scrollbar{
  width:6px;
}
.channel-list::-webkit-scrollbar-track,
.column-preview::-webkit-scrollbar-track{
  background:transparent;
}
.channel-list::-webkit-scrollbar-thumb,
.column-preview::-webkit-scrollbar-thumb{
  background:#46464d;
  border-radius:999px;
}

/* On medium screens keep the compact columns and let only the dashboard move horizontally. */
@media(max-width:1120px){
  .workspace{
    grid-template-columns:180px 190px 200px minmax(390px,1fr);
    overflow-x:auto;
    overflow-y:hidden;
  }
  .column{
    min-width:0!important;
  }
}
@media(max-width:820px){
  .workspace{
    grid-template-columns:170px 180px 190px 390px;
  }
  .source-manager-title span{display:none}
  .column-video-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}


/* v8 scalable source selector + full source manager */
.source-manager-title{
  padding:5px 12px 3px;
}
.source-manager-title>div:first-child{
  min-width:0;
}
.source-manager-title>div:first-child>span{
  display:none;
}
.source-head-actions{
  display:flex;
  align-items:center;
  gap:5px;
  flex:0 0 auto;
}
.source-head-actions .secondary,
.source-head-actions .primary{
  height:28px;
  padding:0 9px;
  font-size:9.5px;
}
.scope-row{
  padding:1px 12px 6px;
  gap:4px;
  overflow-x:auto;
  overflow-y:hidden;
  white-space:nowrap;
  scroll-snap-type:x proximity;
}
.scope-chip-wrap{
  gap:1px;
  scroll-snap-align:start;
}
.scope-chip{
  max-width:112px;
  height:27px;
  padding:0 8px;
  font-size:9.7px;
}
.scope-edit{
  width:16px;
  height:22px;
  font-size:12px;
  opacity:.7;
}
.scope-edit:hover{
  opacity:1;
}

.source-manager-modal{
  position:fixed;
  inset:0;
  z-index:75;
  display:grid;
  place-items:center;
  padding:24px;
  background:rgba(0,0,0,.62);
  backdrop-filter:blur(5px);
}
.source-manager-modal[hidden]{display:none}
.source-manager-card{
  width:min(980px,calc(100vw - 40px));
  height:min(78vh,760px);
  display:grid;
  grid-template-rows:auto auto auto minmax(0,1fr);
  overflow:hidden;
  border:1px solid #34343b;
  border-radius:12px;
  background:#17171a;
  box-shadow:0 24px 80px rgba(0,0,0,.45);
}
.source-manager-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px 11px;
  border-bottom:1px solid var(--line);
}
.source-manager-card-head>div{min-width:0}
.source-manager-card-head strong{
  display:block;
  font-size:15px;
}
.source-manager-card-head span{
  display:block;
  margin-top:3px;
  color:#85858e;
  font-size:10.5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.source-manager-tools{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  padding:10px 16px;
}
.source-manager-tools input{
  height:34px;
  border:1px solid #35353b;
  border-radius:8px;
  outline:0;
  background:#111114;
  color:#fff;
  padding:0 10px;
}
.source-manager-tools .primary{
  height:34px;
}
.source-manager-table-head,
.source-manager-row{
  display:grid;
  grid-template-columns:30px minmax(190px,1.5fr) 90px 80px 90px 190px;
  align-items:center;
}
.source-manager-table-head{
  min-height:32px;
}
.source-manager-table-head::before{
  content:"";
}
.source-manager-table-head{
  padding:0 14px;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  background:#1d1d21;
  color:#777781;
  font-size:9.5px;
  font-weight:700;
  text-transform:uppercase;
}
.source-manager-list{
  min-height:0;
  overflow:auto;
}
.source-manager-row{
  min-height:52px;
  padding:0 14px;
  border-bottom:1px solid #28282d;
}
.source-manager-row:hover{
  background:#1b1b1f;
}
.source-manager-drag{
  width:24px;
  height:32px;
  display:grid;
  place-items:center;
  border:0;
  border-radius:6px;
  background:transparent;
  color:#6f6f78;
  cursor:grab;
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
}
.source-manager-drag span{
  display:block;
  transform:rotate(90deg);
  letter-spacing:-2px;
  font-size:15px;
  line-height:1;
}
.source-manager-drag:hover{
  background:#25252a;
  color:#b9b9c1;
}
.source-manager-drag:active,
.source-manager-row.dragging .source-manager-drag{
  cursor:grabbing;
}
.source-manager-drag:disabled{
  opacity:.25;
  cursor:default;
}
.source-manager-row.dragging{
  position:relative;
  z-index:3;
  background:#242429;
  box-shadow:0 6px 18px rgba(0,0,0,.35);
  opacity:.94;
}
.source-manager-reordering,
.source-manager-reordering *{
  cursor:grabbing!important;
}
.source-manager-name{
  min-width:0;
  border:0;
  background:transparent;
  color:inherit;
  text-align:left;
  padding:0;
}
.source-manager-name strong{
  display:block;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  font-size:11.5px;
}
.source-manager-name span{
  display:block;
  margin-top:2px;
  color:#777;
  font-size:9.5px;
}
.source-manager-stat{
  color:#b5b5bd;
  font-size:11px;
}
.source-manager-actions{
  display:flex;
  justify-content:flex-end;
  gap:5px;
}
.source-manager-actions button{
  height:28px;
  padding:0 8px;
  font-size:9.5px;
}

@media(max-width:760px){
  .source-head-actions .secondary{
    display:none;
  }
  .source-manager-modal{
    padding:8px;
  }
  .source-manager-card{
    width:100%;
    height:92vh;
  }
  .source-manager-table-head,
  .source-manager-row{
    min-width:700px;
  }
  .source-manager-list{
    overflow:auto;
  }
}


/* v9 compact icon language and secondary source menu */
.action-icon{
  width:24px;
  height:24px;
  display:inline-grid;
  place-items:center;
  padding:0;
  border:1px solid #3a3a40;
  border-radius:6px;
  background:#222226;
  color:#d8d8de;
  font-size:12px;
  font-weight:750;
  line-height:1;
}
.action-icon.select{
  background:#f3f3f4;
  border-color:#f3f3f4;
  color:#111;
}
.action-icon.block{
  background:#251719;
  border-color:#553036;
  color:#ff858b;
}
.action-icon.restore{
  background:#1d2420;
  border-color:#365442;
  color:#8fe2a7;
}
.action-icon.remove{
  background:#222226;
  color:#c5c5cb;
}
.action-icon.more{
  color:#aaaab2;
}
.action-icon.close{
  color:#8a8a93;
}
.action-icon.active{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.09);
}
.column[data-column="suggested"] .action-icon,
.column[data-column="selected"] .action-icon,
.column[data-column="blocked"] .action-icon{
  width:21px;
  height:21px;
  border-radius:5px;
  font-size:10px;
}
.search-result .action-icon{
  width:23px;
  height:23px;
  font-size:10.5px;
}
.preview-actions .action-icon{
  width:25px;
  height:25px;
}
.preview-more{
  padding:6px 7px 7px;
  border-bottom:1px solid var(--line);
  background:#18181b;
}
.preview-more[hidden]{display:none}
.preview-more-head{
  min-height:26px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:5px;
}
.preview-more-head strong{
  color:#85858e;
  font-size:8.5px;
  text-transform:uppercase;
}
.preview-more .scope-assign-row{
  display:flex;
  gap:4px;
  overflow-x:auto;
  scrollbar-width:thin;
}
.preview-more .assign-chip{
  flex:0 0 auto;
}

/* Remove visual weight from source header controls. */
.source-head-actions .secondary{
  background:#1b1b1f;
  border-color:#303036;
  color:#aaa;
}
.source-head-actions .primary{
  background:#f2f2f3;
  color:#111;
}


/* v10 readability pass + clean source bar + video search grid */
.scope-chip-wrap{gap:0}
.scope-edit{display:none!important}
.scope-chip{
  max-width:118px;
  height:29px;
  padding:0 9px;
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-size:10.6px;
}
.scope-name{
  min-width:0;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.scope-count{
  flex:0 0 auto;
  color:#808089;
  font-size:9.2px;
}
.scope-chip.active .scope-count{color:#666}

.column-head strong{font-size:11.5px}
.column-head span{font-size:9.5px}

.column[data-column="suggested"] .channel-copy strong,
.column[data-column="selected"] .channel-copy strong,
.column[data-column="blocked"] .channel-copy strong{
  font-size:10.8px;
}
.channel-copy strong{font-size:11.2px}
.search-column .search-box input{font-size:11.2px}
.search-mode-btn{
  font-size:9.8px;
  height:24px;
}
.action-icon{
  width:23px;
  height:23px;
  font-size:11px;
}
.column[data-column="suggested"] .action-icon,
.column[data-column="selected"] .action-icon,
.column[data-column="blocked"] .action-icon{
  width:22px;
  height:22px;
  font-size:10.5px;
}

/* Video search results: visual grid instead of dense text rows. */
.search-column .search-results.video-search-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
  align-content:start;
  padding:7px;
  overflow-y:auto;
}
.video-search-card{
  min-width:0;
  border:1px solid #2d2d33;
  border-radius:8px;
  overflow:hidden;
  background:#18181b;
  cursor:pointer;
  transition:border-color .12s ease,transform .12s ease;
}
.video-search-card:hover{
  border-color:#494950;
  transform:translateY(-1px);
}
.video-search-thumb-wrap{
  width:100%;
  aspect-ratio:16/9;
  overflow:hidden;
  background:#000;
}
.video-search-thumb{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.video-search-copy{
  padding:6px 7px 7px;
}
.video-search-copy strong{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  font-size:10.2px;
  line-height:1.28;
}
.video-search-copy span{
  display:block;
  margin-top:3px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  color:#808089;
  font-size:9px;
}

@media(max-width:1250px){
  .search-column .search-results.video-search-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}
@media(max-width:900px){
  .search-column .search-results.video-search-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}


/* v11 hover-only row actions + calmer check buttons */
.action-icon.select{
  background:#1d2420;
  border-color:#355542;
  color:#8fe2a7;
}
.action-icon.select:hover{
  background:#243029;
  border-color:#4f7c61;
}
.action-icon.select.active{
  background:#243029;
  color:#a9f0bb;
}
.column[data-column="blocked"] .action-icon.restore{
  background:#1d2420;
  border-color:#355542;
  color:#8fe2a7;
}

/* Hide row actions until the user reaches that row. */
@media(hover:hover) and (pointer:fine){
  .column[data-column="blocked"] .channel-card .card-actions,
  .column[data-column="suggested"] .channel-card .card-actions,
  .column[data-column="selected"] .channel-card .card-actions,
  .search-results .channel-card .card-actions{
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transform:translateX(3px);
    transition:opacity .1s ease,transform .1s ease,visibility .1s;
  }
  .column[data-column="blocked"] .channel-card:hover .card-actions,
  .column[data-column="blocked"] .channel-card:focus-within .card-actions,
  .column[data-column="suggested"] .channel-card:hover .card-actions,
  .column[data-column="suggested"] .channel-card:focus-within .card-actions,
  .column[data-column="selected"] .channel-card:hover .card-actions,
  .column[data-column="selected"] .channel-card:focus-within .card-actions,
  .search-results .channel-card:hover .card-actions,
  .search-results .channel-card:focus-within .card-actions{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transform:none;
  }
}

/* Touch devices keep controls visible because there is no hover. */
@media(hover:none),(pointer:coarse){
  .channel-card .card-actions{
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
    transform:none!important;
  }
}

/* Other-source row is a normal part of the channel preview now. */
.preview-more{
  display:block!important;
  padding:5px 7px 6px;
}
.preview-more-head{
  min-height:20px;
  margin-bottom:4px;
}
.preview-more-head strong{
  font-size:8.8px;
}


/* v12 typography unification + readability */
:root{
  --ui-font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 15px;
  --fs-xl: 16px;
}

html,
body,
button,
input,
select,
textarea{
  font-family:var(--ui-font)!important;
}

body{
  font-size:var(--fs-md);
  line-height:1.4;
}

/* Header */
.brand strong{
  font-size:15px;
  font-weight:700;
}
.title-wrap strong{
  font-size:15px;
  font-weight:700;
}
.title-wrap>span{
  font-size:12px;
}

/* Source selector row */
.source-manager-title strong{
  font-size:15px;
  font-weight:700;
}
.source-manager-title span{
  font-size:12px;
}
.scope-chip{
  font-size:13px;
  font-weight:600;
}
.scope-count{
  font-size:11px;
}

/* Column headings */
.column-head strong{
  font-size:14px!important;
  font-weight:700;
}
.column-head span{
  font-size:11px!important;
}

/* Left three columns */
.column[data-column="suggested"] .channel-copy strong,
.column[data-column="selected"] .channel-copy strong,
.column[data-column="blocked"] .channel-copy strong{
  font-size:13px!important;
  font-weight:600;
  line-height:1.25;
}
.column[data-column="suggested"] .channel-copy span,
.column[data-column="selected"] .channel-copy span,
.column[data-column="blocked"] .channel-copy span{
  font-size:11px!important;
}
.column[data-column="suggested"] .channel-card,
.column[data-column="selected"] .channel-card,
.column[data-column="blocked"] .channel-card{
  min-height:42px;
  height:42px;
}
.column[data-column="suggested"] .channel-avatar,
.column[data-column="selected"] .channel-avatar,
.column[data-column="blocked"] .channel-avatar{
  width:26px;
  height:26px;
}

/* Search / view column */
.search-mode-btn{
  font-size:12px;
  font-weight:600;
}
.search-column .search-box input{
  font-size:14px!important;
}
.search-column .search-box button{
  font-size:13px;
  font-weight:600;
}
.search-column .status{
  font-size:11px;
}
.search-results .channel-copy strong{
  font-size:13px;
}
.search-results .channel-copy span{
  font-size:11px;
}

/* Preview */
.column-preview .preview-identity strong{
  font-size:14px;
  font-weight:700;
}
.column-preview .preview-identity span{
  font-size:11px;
}
.preview-more-head strong{
  font-size:11px;
}
.assign-chip,
.source-mini-chip{
  font-size:11px;
}

/* Video cards */
.column-preview .preview-toolbar strong{
  font-size:13px;
  font-weight:700;
}
.column-video-grid .video-copy strong{
  font-size:12px!important;
  line-height:1.3;
}
.column-video-grid .video-copy span{
  font-size:10px!important;
}
.video-search-copy strong{
  font-size:12px!important;
  line-height:1.3;
}
.video-search-copy span{
  font-size:10px!important;
}

/* Icon buttons: slightly larger hit target without visually dominating */
.action-icon{
  width:24px;
  height:24px;
  font-size:12px;
}
.column[data-column="suggested"] .action-icon,
.column[data-column="selected"] .action-icon,
.column[data-column="blocked"] .action-icon{
  width:23px;
  height:23px;
  font-size:11px;
}

/* Manager modal */
.source-manager-card-head strong{
  font-size:16px;
}
.source-manager-card-head span{
  font-size:12px;
}
.source-manager-name strong{
  font-size:13px;
}
.source-manager-name span,
.source-manager-stat{
  font-size:11px;
}
.source-manager-tools input{
  font-size:13px;
}
.source-manager-actions button{
  font-size:11px;
}

/* Keep the compact layout while avoiding tiny text */
@media(max-width:1120px){
  .scope-chip{
    font-size:12px;
  }
  .column[data-column="suggested"] .channel-copy strong,
  .column[data-column="selected"] .channel-copy strong,
  .column[data-column="blocked"] .channel-copy strong{
    font-size:12px!important;
  }
  .column-video-grid .video-copy strong,
  .video-search-copy strong{
    font-size:11.5px!important;
  }
}


/* v13 richer video search metadata */
.video-search-copy{
  padding:7px 8px 8px;
}
.video-search-copy>strong{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  font-size:12.5px!important;
  line-height:1.28;
}
.video-search-channel{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  margin-top:6px;
}
.video-search-avatar{
  flex:0 0 auto;
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
  overflow:hidden;
  border-radius:50%;
  background:#2a2a2f;
  color:#aaa;
  font-size:9px;
  font-weight:700;
}
.video-search-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.video-search-channel-name{
  min-width:0;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  color:#d7d7dc;
  font-size:11px;
  font-weight:600;
}
.video-search-meta{
  display:flex;
  flex-wrap:wrap;
  gap:4px 8px;
  margin-top:5px;
  color:#85858e;
  font-size:10px;
}
.video-search-meta span+span::before{
  content:"·";
  margin-right:8px;
  color:#55555d;
}
.video-source-badges{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin-top:6px;
}
.video-source-badge{
  height:19px;
  display:inline-flex;
  align-items:center;
  padding:0 6px;
  border:1px solid #34343a;
  border-radius:999px;
  background:#202024;
  color:#aaa;
  font-size:9px;
  line-height:1;
}
.video-source-badge.selected{
  border-color:#355542;
  color:#91dca7;
  background:#1c2420;
}
.video-source-badge.blocked{
  border-color:#553036;
  color:#ef8a90;
  background:#251719;
}
.video-source-badge.suggested{
  border-color:#3d3d44;
  color:#bbb;
}


/* v14 compact header + slightly larger UI + calmer video spacing */
html,body{
  height:100%;
}
body{
  display:block;
  font-size:15px;
}
.topbar{
  display:none!important;
}
main{
  height:100vh;
  grid-template-rows:auto minmax(0,1fr);
}
.source-manager-head{
  border-bottom:1px solid var(--line);
}
.source-manager-title{
  min-height:46px;
  padding:7px 10px 5px;
}
.source-title-main{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.brand-inline{
  flex:0 0 auto;
  gap:7px;
}
.brand-inline .brand-mark{
  width:26px;
  height:19px;
}
.brand-inline strong{
  font-size:15px;
}
.source-title-divider{
  flex:0 0 1px;
  width:1px;
  height:22px;
  background:#313137;
}
.source-title-copy{
  min-width:0;
}
.source-title-copy>strong{
  display:block;
  font-size:15px;
  line-height:1.15;
}
.source-title-copy>span{
  display:block;
  margin-top:2px;
  color:#85858e;
  font-size:11.5px;
}
.source-head-actions{
  gap:6px;
}
.source-head-actions .secondary,
.source-head-actions .primary,
.source-head-actions .ghost,
.source-head-actions .icon-btn{
  height:31px;
  font-size:11px;
}
.source-head-actions .icon-btn{
  width:31px;
}
.scope-row{
  padding:2px 10px 7px;
}
.scope-chip{
  height:30px;
  font-size:12.5px;
}
.scope-count{
  font-size:10.5px;
}

/* Make the whole manager easier to read without bloating the 3 narrow columns. */
.column-head{
  height:36px;
  min-height:36px;
}
.column-head strong{
  font-size:14.5px!important;
}
.column[data-column="blocked"] .channel-card,
.column[data-column="suggested"] .channel-card,
.column[data-column="selected"] .channel-card{
  height:44px;
  min-height:44px;
}
.column[data-column="blocked"] .channel-copy strong,
.column[data-column="suggested"] .channel-copy strong,
.column[data-column="selected"] .channel-copy strong{
  font-size:13.2px!important;
}
.search-mode-btn{
  font-size:12.2px;
}
.search-column .search-box input{
  font-size:14.2px!important;
}
.search-column .search-box button{
  font-size:13px;
}

/* Give video cards enough breathing room. */
.column-video-grid{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:10px!important;
  padding:0 10px 12px!important;
}
.video-card,
.video-search-card{
  border-radius:10px;
}
.video-card{
  border-color:#323238;
}
.video-card:hover,
.video-search-card:hover{
  border-color:#55555d;
}
.column-video-grid .video-copy{
  padding:7px 8px 8px;
}
.column-video-grid .video-copy strong{
  font-size:12.3px!important;
  line-height:1.32;
}
.column-video-grid .video-copy span{
  font-size:10.5px!important;
}
.preview-toolbar{
  padding-left:10px!important;
  padding-right:10px!important;
}
.preview-more{
  padding-left:10px;
  padding-right:10px;
}
.preview-head{
  padding-left:10px!important;
  padding-right:10px!important;
}

/* Search video cards also need separation and readable metadata. */
.search-column .search-results.video-search-grid{
  gap:10px;
  padding:9px 10px 12px;
}
.video-search-copy{
  padding:8px 9px 9px;
}
.video-search-copy>strong{
  font-size:12.6px!important;
}
.video-search-channel-name{
  font-size:11.3px;
}
.video-search-meta{
  font-size:10.5px;
}

/* On slightly narrower screens, 3 columns avoids crushed cards. */
@media(max-width:1280px){
  .column-video-grid,
  .search-column .search-results.video-search-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}


/* v15 unified metadata for preview video cards */
.video-card-channel{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  margin-top:6px;
}
.video-card-avatar{
  flex:0 0 auto;
  width:21px;
  height:21px;
  display:grid;
  place-items:center;
  overflow:hidden;
  border-radius:50%;
  background:#2a2a2f;
  color:#aaa;
  font-size:9px;
  font-weight:700;
}
.video-card-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.video-card-channel-name{
  min-width:0;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  color:#d8d8dd;
  font-size:11px;
  font-weight:600;
}
.video-card-meta{
  display:flex;
  flex-wrap:wrap;
  gap:4px 8px;
  margin-top:5px;
  color:#85858e;
  font-size:10px;
}
.video-card-meta span+span::before{
  content:"·";
  margin-right:8px;
  color:#55555d;
}
.column-video-grid .video-copy{
  padding-bottom:9px;
}


/* v16 preview video grid: 3 cards for readability */
.column-video-grid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
@media(max-width:1050px){
  .column-video-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}


/* v17 local back navigation for search/view panel */
.search-head-title{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}
.search-back{
  width:26px;
  height:26px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  padding:0;
  border:1px solid #35353b;
  border-radius:6px;
  background:#202024;
  color:#d8d8dd;
  font-size:15px;
  line-height:1;
}
.search-back[hidden]{
  display:none!important;
}
.search-back:hover{
  background:#29292e;
  border-color:#46464d;
}

/* YT UX rule 41 — real search fields: one microphone on the right,
   without shifting the submit/management action into the input. */
.search-column .search-box{
  grid-template-columns:minmax(0,1fr) 38px 43px;
}
.search-column .search-box .source-voice-button{
  box-sizing:border-box;
  width:38px!important;
  min-width:38px;
  height:100%;
  display:grid;
  place-items:center;
  padding:0!important;
  border:0!important;
  border-left:1px solid #35353b!important;
  border-radius:0;
  background:#1d1d21!important;
  color:#bdbdc5;
  touch-action:manipulation;
}
.source-voice-button svg{display:block;width:19px;height:19px;pointer-events:none}
.source-voice-button[aria-pressed="true"]{
  color:#ff625a!important;
  background:#3a2426!important;
}
.search-column .search-box .search-submit{
  width:43px;
}
.source-manager-search-wrap{
  display:block;position:relative;min-width:0;
}
.source-manager-search-wrap input{
  box-sizing:border-box;width:100%;min-width:0;
  padding-right:44px!important;
}
.source-manager-search-wrap .source-voice-button{
  position:absolute;
  display:grid;place-items:center;
  width:36px;height:34px;
  box-sizing:border-box;
  border:0;
  border-left:1px solid #35353b;
  border-radius:0 8px 8px 0;
  color:#bdbdc5;background:#202024;
  top:0;right:0;z-index:2;
  touch-action:manipulation;
}
.source-voice-button:focus-visible{outline:2px solid #72baff;outline-offset:-2px}
.search-box input[type=search]::-webkit-search-cancel-button,
.source-manager-search-wrap input[type=search]::-webkit-search-cancel-button{
  display:none;
}
@media(hover:none) and (pointer:coarse){
  .search-column .search-box input,
  .source-manager-search-wrap input{font-size:16px!important}
}

/* YT UX rule 41: mobile tap targets, not merely visual icon size. */
@media(hover:none) and (pointer:coarse){
  .search-column .search-box{
    flex:0 0 42px;
    height:42px;
    min-height:42px;
  }
  .search-column .search-box input{height:40px}
  .search-column .search-box .source-voice-button,
  .search-column .search-box .search-submit{
    height:42px;
    min-height:42px;
  }
  .source-manager-tools input,
  .source-manager-search-wrap .source-voice-button,
  .source-manager-tools .primary{
    height:42px;
    min-height:42px;
  }
}
