.library-controls{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
.library-controls #video-sort{width:145px;min-height:36px;font-size:13px;padding-top:7px;padding-bottom:7px;background-color:transparent}
.library-controls .filter-bar{margin:0}
.asset-card{position:relative;overflow:visible;display:flex;flex-direction:column}
.asset-open{border-radius:10px 10px 0 0;overflow:hidden;flex:1}
.asset-card .card-body{padding:14px 16px 7px}
.asset-card .card-body h3{font-size:17px;margin:0;line-height:1.3}
.card-footer{display:flex;align-items:center;min-height:32px;padding:0 16px 14px;gap:10px}
.upload-date{font-size:12px;color:var(--muted)}
.asset-menu{position:relative;margin-left:auto}
.asset-menu summary{list-style:none;font-size:23px;line-height:1;cursor:pointer;padding:0 3px;color:var(--muted)}
.asset-menu summary::-webkit-details-marker{display:none}
.asset-menu>div{position:absolute;z-index:5;right:0;top:26px;min-width:140px;padding:5px;border:1px solid var(--line);background:#fff;box-shadow:0 5px 20px #0002;border-radius:8px}
.asset-menu button{display:block;width:100%;border:0;border-radius:5px;padding:10px;background:none;font-size:13px;text-align:left}
.asset-menu button:hover{background:var(--paper)}
.asset-card:has(.asset-menu[open]){z-index:5}
.asset-card[draggable=true]{cursor:grab}
.library-empty{border:1px dashed var(--line);border-radius:12px;padding:40px 20px;text-align:center;color:var(--muted);background:#ffffff60}
.library-empty h3{color:var(--ink);font-size:18px}
.library-empty p{font-size:14px;margin-bottom:0}
@media(max-width:1150px){.library-controls{justify-content:flex-start;gap:9px}.batch-header{align-items:flex-start;flex-wrap:wrap}}
@media(max-width:450px){.asset-card .card-body{padding:12px 12px 6px}.asset-card .card-body h3{font-size:15px}.card-footer{padding:0 12px 12px}.upload-date{font-size:11px}.library-controls .filter{font-size:12px;padding:8px}.library-controls #video-sort{font-size:12px;width:135px}}

.page-heading{align-items:center;margin-bottom:24px;gap:16px}.page-heading h1{font-size:28px;line-height:1.2;margin:0;letter-spacing:-.025em}.page-heading .page-actions{margin-top:0!important}@media(max-width:800px){.page-heading h1{font-size:25px}}

.brand-voice-settings{max-width:900px}

.dashboard-activity{margin-top:26px}.channel-settings{max-width:900px}
/* Let data-heavy workspaces use the monitor width; keep form and reading widths independent. */
@media (min-width: 680px) {
  .library-tools > select { width:auto; max-width:180px; }
  .library-tools .library-new-only { margin:0; }
  .library-tools .library-options { margin-inline-start:auto; }
  .library-tools .library-options > div { inset-inline:auto 0; }
}
@media (min-width: 961px) {
  .main:has(.library-tools, .pc-container, .internal-upload-grid) { max-width:none; }
  .asset-grid { grid-template-columns:repeat(auto-fill,minmax(235px,1fr)); }
}
@media (min-width: 1320px) {
  .profile-settings { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
.profile-settings > form { min-width:0; overflow-wrap:anywhere; }
@media (max-width: 540px) {
  .channel-settings .channel-row { display:grid; grid-template-columns:auto minmax(0,1fr); gap:8px 12px; }
  .channel-settings .channel-row > :nth-child(n+3) { grid-column:2; margin:0; justify-self:start; }
  .channel-settings .channel-handle { overflow-wrap:anywhere; }
}
.library-review-status{display:inline-block;margin-top:6px;font-size:12px;font-weight:600;line-height:1.4;color:var(--muted)}
.library-review-status[data-status="needs_review"]{padding:2px 8px;border-radius:5px;background:var(--brand-wash);color:var(--brand-text)}
.asset-card.is-new{border-color:var(--brand-edge,#63897f);box-shadow:0 0 0 1px var(--brand-edge,#63897f)}
.asset-new-badge{position:absolute;top:10px;right:10px;z-index:2;border-radius:6px;background:var(--brand-wash,#e7f1ed);color:var(--brand-text,#285849);border:1px solid var(--brand-edge,#63897f);padding:5px 9px;font-size:14px;font-weight:700;pointer-events:none}
.library-new-only{display:flex;align-items:center;gap:8px;white-space:nowrap;font-size:14px;color:var(--ink);padding:8px 3px;cursor:pointer}
.library-new-only input{width:17px;height:17px;min-height:0;margin:0;accent-color:var(--brand-text,#285849)}
.library-tools .library-new-only{display:inline-flex;justify-content:flex-start;gap:8px;min-height:42px}
.library-tools .library-new-only input{flex:0 0 17px;width:17px;min-width:17px;max-width:17px;height:17px;min-height:17px}

.footage-intake {padding:clamp(16px,3vw,32px);max-width:900px}
.footage-intake p {line-height:1.5;margin:0 0 18px}
.footage-drop {display:grid;justify-items:center;text-align:center;gap:12px;border:2px dashed var(--line);border-radius:12px;padding:28px 12px;cursor:pointer}
.footage-drop input {max-width:100%}
.footage-intake h2 {margin-top:24px}
.footage-row {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid var(--line);padding:12px 0;overflow-wrap:anywhere}
.footage-row span,.footage-drop small {color:var(--muted)}

.trash-file{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-top:1px solid var(--line)}
.trash-file>div{min-width:0;overflow-wrap:anywhere}.trash-file small{display:block;color:var(--muted);margin-top:4px}.trash-file button{flex:none}

.library-options { position: relative; }
.library-options summary { cursor: pointer; list-style: none; }
.library-options summary::-webkit-details-marker { display: none; }
.library-options summary::after { content: "▾"; margin-left: .35em; }
.library-options > div {
  position: absolute; z-index: 8; inset-block-start: calc(100% + 4px); inset-inline-end: 0;
  min-width: 150px; padding: 4px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 6px 18px #0002;
}
.library-options button { width: 100%; padding: 10px 12px; border: 0; border-radius: 6px; text-align: start; color: var(--ink); background: transparent; }
.library-options button:hover, .library-options button:focus-visible { background: var(--hover); }
.asset-card:has(.asset-select:checked) { outline: 2px solid #578680; outline-offset: 1px; }
.main:has(.library-selection-bar) { padding-bottom: calc(104px + var(--safe-b)); }
.library-selection-bar {
  position: fixed; z-index: 12; inset: auto 0 calc(16px + var(--safe-b)) 238px; margin-inline: auto;
  width: max-content; max-width: 100%; display: flex; gap: 4px; align-items: center;
  padding: 5px 8px; border: 1px solid #43534e; border-radius: 16px;
  background: #20322e; color: #f3f7f5; box-shadow: 0 4px 20px #0003;
}
.library-selection-bar button {
  display: grid; place-content: center; justify-items: center; gap: 3px; min-width: 64px;
  min-height: 48px; border: 0; border-radius: 8px; background: transparent; color: inherit;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.library-selection-bar button:hover, .library-selection-bar button:focus-visible { background: #384b46; }
.library-selection-bar svg { width: 20px; height: 20px; }
.selection-count { margin-inline-start: 6px; border-inline-start: 1px solid #687874; padding-inline: 14px 4px; white-space: nowrap; font-size: 14px; font-weight: 650; }
.library-selection-bar .clear-selection { min-width: 44px; min-height: 44px; }
body:has(.library-selection-bar) #toast { bottom: calc(92px + var(--safe-b)); }
@media(max-width:1150px) { .library-selection-bar { left: 210px; } }
@media(max-width:800px), (max-width:960px) and (pointer:coarse) {
  .library-selection-bar {
    inset: auto 0 0; width: auto; max-width: none; border-radius: 0; border-width: 1px 0 0;
    padding: 5px calc(12px + var(--safe-r)) calc(5px + var(--safe-b)) calc(12px + var(--safe-l));
  }
  .selection-count { margin-inline-start: auto; border: 0; padding-inline: 4px; }
  body:has(.library-selection-bar) .upload-tray { bottom: calc(70px + var(--safe-b)); }
  .library-options > div { inset-inline: 0 auto; }
}
.library-action-form,.library-action-form label,.library-share-row{display:grid;gap:10px}
.library-action-form select,.library-link-field input{width:100%;min-width:0;padding:10px;border:1px solid var(--field-line);border-radius:8px;color:var(--ink);background:var(--panel)}
.library-action-form button,.library-share-row>button{justify-self:start}
.library-share-row{padding-block:14px;border-top:1px solid var(--line);overflow-wrap:anywhere}
.library-link-field{display:flex;gap:8px}.library-link-field button{flex:none}
@media(max-width:540px){
  .library-selection-bar:has([data-library-share]){display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) 44px;gap:0}
  .library-selection-bar:has([data-library-share]) .selection-count{grid-area:1/1/2/5;justify-self:start;margin:0;padding-inline:10px}
  .library-selection-bar:has([data-library-share]) .clear-selection{grid-area:1/5;min-height:36px}
  .library-selection-bar:has([data-library-share]) button:not(.clear-selection){grid-row:2;min-width:0}
  .main:has([data-library-share]){padding-bottom:calc(120px + var(--safe-b))}
  body:has([data-library-share]) .upload-tray,body:has([data-library-share]) #toast{bottom:calc(106px + var(--safe-b))}
}

body:has(.library-selection-bar) #toast { pointer-events: none; }
.library-share-row p { white-space:pre-wrap; overflow-wrap:anywhere; }

.share-settings-dialog {
  width:min(470px,94vw); max-width:100%; max-height:min(90dvh,800px); margin:auto;
  padding:0; overflow:hidden; border:1px solid var(--field-line); border-radius:20px;
  background:var(--panel); color:var(--ink); box-shadow:0 24px 80px #00120e36;
}
.share-settings-dialog[open] { display:flex; flex-direction:column; }
.share-settings-dialog::backdrop { background:rgb(9 22 19 / 46%); }
.share-settings-dialog > div { padding:16px 22px; border-bottom:1px solid var(--line); gap:12px; }
.share-settings-dialog h2 { margin:0; font-size:22px; letter-spacing:-.025em; }
.share-settings-dialog [data-close] { display:grid; place-items:center; min-width:44px; min-height:44px; padding:0; border:0; border-radius:50%; background:var(--subtle); }
.share-settings-dialog svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.share-settings { display:flex; flex-direction:column; min-height:0; margin:0; }
.share-settings-body { overflow-y:auto; overscroll-behavior:contain; min-height:0; padding:20px 22px; display:grid; gap:22px; }
.share-settings fieldset { min-width:0; border:0; margin:0; padding:0; }
.share-group-title { display:block; margin:0 0 8px; padding:0; font-weight:700; font-size:14px; color:var(--ink); }
.share-type-picker { position:relative; display:flex; align-items:center; }
.share-type-picker > svg { position:absolute; left:14px; color:var(--muted); pointer-events:none; }
.share-settings .share-type-picker select {
  appearance:none; -webkit-appearance:none; width:100%; min-height:50px; padding:10px 62px 10px 44px;
  border:1px solid var(--field-line); border-radius:12px; background:var(--subtle); color:var(--ink);
  font:inherit; font-size:16px; font-weight:650; cursor:pointer;
}
.share-picker-arrow { position:absolute; inset-inline-end:8px; display:grid; place-items:center; width:34px; height:32px; border-radius:8px; background:var(--panel); color:var(--ink); pointer-events:none; }
.share-picker-arrow svg { transform:rotate(90deg); width:16px; height:16px; stroke-width:2.2; }
.share-description { margin:8px 2px 0; color:var(--muted); font-size:14px; line-height:1.4; }
.share-setting-group { border:1px solid var(--line); border-radius:14px; overflow:hidden; background:var(--subtle); }
.share-switch-row { display:flex; align-items:center; gap:12px; min-height:54px; padding:8px 14px; cursor:pointer; font-size:16px; }
.share-switch-row + .share-switch-row, .share-password { border-top:1px solid var(--line); }
.share-switch-row > svg { color:var(--muted); flex:none; }
.share-switch-row input[type=checkbox] {
  appearance:none; -webkit-appearance:none; position:relative; flex:none; width:44px; height:26px;
  margin:0 0 0 auto; padding:0; border:1px solid var(--muted); border-radius:20px;
  background:var(--field-line); cursor:pointer;
}
.share-switch-row input[type=checkbox]:checked { background:#396753; border-color:#396753; }
.share-switch-row input[type=checkbox]::before { content:''; position:absolute; left:3px; top:3px; width:18px; height:18px; background:white; border-radius:50%; box-shadow:0 1px 3px #0004; }
.share-switch-row input[type=checkbox]:checked::before { transform:translateX(18px); }
.share-settings-dialog :focus-visible { outline:2px solid var(--brand-text); outline-offset:2px; }
.share-password { display:grid; gap:6px; padding:12px 14px; font-weight:600; }
.share-password[hidden],.share-settings footer p:empty { display:none; }
.share-password input { min-width:0; padding:10px; background:var(--panel); color:var(--ink); border:1px solid var(--field-line); border-radius:8px; font:inherit; font-size:16px; }
.share-password small { font-weight:400; color:var(--muted); }
.share-settings footer { flex:none; padding:14px 22px; border-top:1px solid var(--line); }
.share-settings footer p { margin:0 0 10px; }
.share-settings footer .primary { width:100%; display:flex; justify-content:center; align-items:center; gap:8px; min-height:46px; border-radius:10px; background:#294f42; color:white; }
@media(max-width:600px) {
  .share-settings-dialog { width:100%; max-height:calc(100dvh - env(safe-area-inset-top) - 10px); inset:auto 0 0; margin:0; border-radius:20px 20px 0 0; }
  .share-settings-dialog > div { padding:12px 18px; }
  .share-settings-body { padding:16px 18px; gap:17px; }
  .share-settings footer { padding:12px 18px max(14px,env(safe-area-inset-bottom)); }
}
@media(forced-colors:active) {
  .share-switch-row input[type=checkbox] { appearance:auto; }
  .share-switch-row input[type=checkbox]::before { display:none; }
}

/* Keep library controls compact and let the results take the width. */
.video-library .page-heading { margin-bottom: 12px; }
.library-compact-tools { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.library-compact-tools > input[type="search"] { flex: 1 1 120px; min-width: 0; max-width: 300px; min-height: 44px; margin: 0; }
.library-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.library-compact-tools .library-tool-icon {
  position: relative; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; color: var(--ink);
}
.library-tool-icon svg { width: 20px; height: 20px; }
.library-tool-icon:hover, .library-tool-icon[aria-expanded="true"], .library-filter[open] > summary { background: var(--hover); }
.library-search-indicator, .library-filter-badge {
  position: absolute; inset: 3px 3px auto auto; background: var(--brand-text); color: var(--panel); border-radius: 999px;
}
.library-search-indicator { width: 7px; height: 7px; }
.library-filter-badge { display: grid; place-items: center; min-width: 14px; height: 14px; padding-inline: 2px; font-size: 9px; line-height: 1; }
.library-filter { flex: 0 0 auto; margin: 0; }
.library-filter > summary { cursor: pointer; list-style: none; }
.library-filter > summary::-webkit-details-marker { display: none; }
.library-filter-panel {
  position: absolute; inset: calc(100% + 8px) auto auto 0; z-index: 12;
  width: min(340px,100%); max-height: min(65dvh,480px); overflow-y: auto;
  display: grid; gap: 10px; margin: 0; padding: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px #0003;
}
.library-filter-panel .library-controls { justify-content: start; }
.library-filter-panel select { width: 100%; }
.library-filter-panel .library-options > div { position: static; box-shadow: none; }
.library-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.library-filter-chips:not(:empty) { margin: 0 0 12px; }
.video-library .review-alerts:not(:empty) { margin-bottom: 12px; }
:is(.video-library,.dashboard-videos) .asset-card .poster { border-radius: 0; }
:is(.video-library,.dashboard-videos) .asset-card .card-body { padding-bottom: 6px; }
.dashboard-videos { margin-bottom: 24px; }
.dashboard-videos .batch-header { align-items: center; }
.dashboard-videos .batch-header h2 { margin: 0; }
@media (min-width: 961px) {
  .main:has(.dashboard-videos,.video-library) { max-width: none; }

}
@media (max-width: 500px) {
  .library-compact-tools input[type="search"] { font-size: 16px; }
  .video-library .asset-grid, .dashboard-videos .asset-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .dashboard-videos .batch-header, .video-library .page-heading { margin-bottom: 10px; }
}

.library-folder-section { margin-block: 0 24px; }
.library-folder-section > h2, .library-files-heading { margin: 0 0 10px; font-size: 17px; }
.library-folder-card {
  --folder-face: #e4e4e4;
  --folder-rim: #a8a8a8;
  --folder-tab: #d0d0d0;
  --folder-ink: #353535;
  display: grid; align-content: start; min-width: 0; width: 100%;
  padding: 0; border: 0; background: transparent; color: var(--ink); text-align: start;
}
[data-color-mode="dark"] .library-folder-card {
  --folder-face: #343434;
  --folder-rim: #727272;
  --folder-tab: #474747;
  --folder-ink: #e9e9e9;
}
.library-folder-tab {
  position: relative; z-index: 1; display: inline-flex; justify-self: start; align-items: center;
  gap: 6px; min-width: 44%; height: 26px; padding: 0 13px;
  border: 1px solid var(--folder-rim); border-bottom: 0; border-radius: 10px 14px 0 0;
  background: var(--folder-tab); color: var(--folder-ink); font-size: 11px; font-weight: 700;
}
.library-folder-tab svg { width: 15px; height: 15px; }
.library-folder-body {
  display: grid; gap: 0; padding: 8px 8px 0; overflow: hidden;
  border: 1px solid var(--folder-rim); border-radius: 0 12px 12px 12px; background: var(--folder-face);
}
.library-folder-card:hover .library-folder-body, .library-folder-card.drop-over .library-folder-body {
  border-color: var(--folder-ink);
}
.library-folder-cover {
  position: relative; display: grid; place-items: center; overflow: hidden;
  aspect-ratio: 16/8; border: 1px solid color-mix(in srgb, var(--folder-rim) 65%, transparent);
  border-radius: 7px; background: color-mix(in srgb, var(--folder-tab) 62%, var(--folder-face));
}
.library-folder-cover > .poster { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; pointer-events: none; }
.library-folder-cover .video-still { object-fit: cover; }
.library-folder-cover :is(.poster-play,.duration,.video-poster-fallback) { display: none; }
.library-folder-icon { position: absolute; display: grid; place-items: center; color: var(--folder-ink); }
.library-folder-icon svg { width: 34px; height: 34px; }
.library-folder-cover:has(.video-still:not([data-thumbnail-fallbacks])) .library-folder-icon { display: none; }
.library-folder-info { display: grid; gap: 4px; padding: 10px 4px 12px; min-width: 0; }
.library-folder-info strong { font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.library-folder-info small { color: var(--folder-ink); font-size: 12px; }
.library-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block: 0 12px; color: var(--muted); }
.library-breadcrumb > h2 { min-width: 0; margin: 0; color: var(--ink); font-size: 18px; overflow-wrap: anywhere; }
:is(.library-folder-card,.library-breadcrumb button).drop-ready { outline: 2px dashed var(--brand-marker); outline-offset: 2px; }
:is(.library-folder-card,.library-breadcrumb button).drop-over { outline: 3px solid var(--brand-marker); outline-offset: 2px; }
@media(max-width:500px) {
  .library-folder-section { margin-bottom: 18px; }
  .library-folder-body { padding: 6px 6px 0; }
  .library-folder-info { padding: 9px 3px 10px; }
}

.final-files-path { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; overflow-wrap: anywhere; }
.final-files-path:empty, [data-final-status]:empty { display: none; }
.final-files-list { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.final-files-list > li + li { border-top: 1px solid var(--line); }
.final-file-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.final-file-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.final-file-name svg { flex: 0 0 20px; width: 20px; height: 20px; color: var(--muted); }
.final-file-name .btn { text-align: start; min-width: 0; }
.final-file-row small { color: var(--muted); white-space: nowrap; }
.final-file-row .icon-btn { flex: 0 0 40px; text-decoration: none; color: var(--ink); }
.final-file-preview { padding: 0 10px 10px; }
.final-file-preview :is(video,img) { display: block; max-width: 100%; max-height: 55dvh; }
@media(max-width:420px) {
  .final-file-row { gap: 6px; padding-inline: 7px; }
  .final-file-row small { display: none; }
}
