/* The approved shell (visual PR A, hi-fi screens 1 and 6): sidebar, top bar and control sizes. Loaded last, so it wins
   over the older layers (style.css, studio-ui.css, ui.css, components.css) without touching them. Desktop only. */

/* ---- sidebar: 232 px, logo mark, group labels, 32 px items with icons and mono counts, avatar footer ---- */
.shell{margin-left:232px}
.sidebar{width:232px;padding:16px 12px;display:flex;flex-direction:column;gap:0;background:var(--surface);border-right:1px solid var(--line)}
.sidebar .brand{display:flex;align-items:center;gap:8px;padding:4px 8px 14px;font:600 14px/20px var(--f-ui);letter-spacing:-.01em;color:var(--ink)}
.logo-mark{width:22px;height:22px;border-radius:6px;background:var(--accent);display:inline-block;position:relative;flex:none}
.logo-mark::after{content:"";position:absolute;left:8px;top:6px;border-left:7px solid var(--accent-ink,#fff);border-top:5px solid transparent;border-bottom:5px solid transparent}
.sidebar nav{display:flex;flex-direction:column;gap:2px}
.sidebar .nav-section{display:flex;justify-content:space-between;align-items:baseline;padding:14px 8px 4px;font:500 11px var(--f-ui);letter-spacing:.07em;text-transform:uppercase;color:var(--faint)}
.sidebar .nav-section em{font-style:normal;text-transform:none;letter-spacing:0;color:var(--muted)}
.sidebar nav a{display:flex;align-items:center;justify-content:flex-start;gap:9px;min-height:32px;padding:6px 8px;border-radius:7px;font:400 13.5px/20px var(--f-ui);color:var(--ink-2)}
.sidebar nav a .nav-t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar nav a .nav-ic{width:16px;height:16px;flex:none;color:var(--muted)}
.sidebar nav a:hover{background:var(--hover);color:var(--ink)}
.sidebar nav a.active,.sidebar nav a[aria-current="page"]{background:var(--accent-soft);color:var(--ink);font-weight:500}
.sidebar nav a.active .nav-ic{color:var(--accent)}
.sidebar nav a .nav-n{margin-left:auto;font:500 11.5px var(--f-mono);color:var(--muted)}
.sidebar .footer{margin-top:auto;display:flex;align-items:center;gap:8px;padding:10px 8px 2px;border-top:1px solid var(--line);font-size:13px;color:var(--ink)}
.sidebar .footer p{margin:0;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
.sidebar .footer .pill{margin-left:auto}
.avatar{width:24px;height:24px;border-radius:50%;background:linear-gradient(135deg,var(--accent),var(--accent-strong,var(--accent)));color:var(--accent-ink,#fff);font:600 11px var(--f-ui);display:inline-grid;place-items:center;flex:none}

/* ---- top bar: the page's own header row, as the approved 56 px bar (crumb, a short note, the page's actions) ---- */
.shell>main{--main-x:40px}
.shell>main:has(>.pagehead:first-child,>.ads>.ad-head:first-child,>.home>.home-head:first-child,>#script-vault-page>[data-vault-content]>.pagehead:first-child){padding-top:0}
.shell>main>.pagehead:first-child,.shell>main>.ads>.ad-head:first-child,.shell>main>.home>.home-head:first-child,.shell>main>#script-vault-page>[data-vault-content]>.pagehead:first-child{
  position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:14px;min-height:56px;margin:0 calc(-1 * var(--main-x)) 24px;padding:8px var(--main-x);
  background:var(--surface);border-bottom:1px solid var(--line);flex-wrap:nowrap}
.shell>main>.pagehead:first-child>div:first-child,.shell>main>.ads>.ad-head:first-child>div:first-child,.shell>main>.home>.home-head:first-child>div:first-child,.shell>main>#script-vault-page>[data-vault-content]>.pagehead:first-child>div:first-child{
  flex:1;min-width:0;display:flex;align-items:baseline;gap:10px;overflow:hidden}
.shell>main>.pagehead:first-child h1,.shell>main>.ads>.ad-head:first-child h1,.shell>main>.home>.home-head:first-child h1,.shell>main>#script-vault-page>[data-vault-content]>.pagehead:first-child h1{
  margin:0;font:600 13.5px/20px var(--f-ui);font-size:13.5px!important;letter-spacing:0!important;color:var(--ink);white-space:nowrap}  /* workspace.css sets every h1 to 28px !important */
.shell>main>.pagehead:first-child p,.shell>main>.ads>.ad-head:first-child p,.shell>main>#script-vault-page>[data-vault-content]>.pagehead:first-child p{
  margin:0;font:400 13px/20px var(--f-ui);color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.shell>main>.home>.home-head:first-child .home-eyebrow{order:2;margin:0;font:500 11.5px var(--f-mono);color:var(--muted);letter-spacing:.04em}
.shell>main>.pagehead:first-child .row,.shell>main>.ads>.ad-head:first-child .row,.shell>main>.home>.home-head:first-child .row,.shell>main>#script-vault-page>[data-vault-content]>.pagehead:first-child .row{flex:none;gap:8px;margin:0}

/* ---- controls at the approved sizes: 34 px fields, 32 px buttons, 28 px pill chips with mono counts ---- */
.shell input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),.shell select{min-height:34px;height:34px;padding:0 10px;border:1px solid var(--line-2);border-radius:8px;font:400 13.5px var(--f-ui);background:var(--surface);color:var(--ink)}
.shell textarea{border:1px solid var(--line-2);border-radius:8px;font:400 13.5px/1.5 var(--f-ui);background:var(--surface);color:var(--ink)}
.shell input:focus-visible,.shell select:focus-visible,.shell textarea:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
/* Buttons get the approved sizes, except inside tiles, segments, scene tools and the big submit panels, which size
   their own buttons (a class="" button counts as class-less) */
.shell :is(button:is(:not([class]),[class=""]),button.primary,button.secondary,button.quiet:not(.icon),button.danger,a.button):not(:is(.writer-source-tabs,.writer-duration-options,.writer-tone-chips,.wb-seg,.segmented,.writer-scene-tools,.video-take-footer,.timeline-stage,.bulk-submit,.wb-summary,.rm-panel) *){min-height:32px;padding-inline:12px;border-radius:8px;font-size:13px;font-weight:500}
.shell :is(button.dense:not(.icon),a.button.dense):not(:is(.writer-source-tabs,.writer-duration-options,.writer-tone-chips,.wb-seg,.segmented,.writer-scene-tools,.video-take-footer,.timeline-stage,.bulk-submit,.wb-summary,.rm-panel) *){min-height:26px;padding-inline:9px;border-radius:7px;font-size:12.5px}  /* list items, tiles and cards that are buttons keep their own layout */
.shell .chip,.shell .lv-chip{min-height:28px;height:auto;padding:3px 10px;border-radius:999px;border:1px solid var(--line-2);background:var(--surface);font:400 12.5px var(--f-ui);color:var(--ink-2)}
.shell .chip.selected,.shell .chip[aria-pressed="true"],.shell .lv-chip.selected{border-color:var(--ink);color:var(--ink);background:var(--hover)}
.shell .pill{font:500 12px var(--f-ui)}

/* ---- lists (visual PR B, hi-fi screen 1): views as tabs, a search field with an icon and a "/" hint, one row of
   filter pills with mono counts and status dots, a frame strip, status pills, progress bars, a row menu, a floating
   bulk bar, and empty states that say what lives there ---- */
.lc-search-wrap{position:relative;display:flex;align-items:center;flex:1 1 280px;min-width:0;max-width:340px}
.lc-search-wrap .lc-search{flex:1;width:100%;min-width:0;padding-left:32px!important;padding-right:30px!important}
.lc-search-ic{position:absolute;left:10px;width:15px;height:15px;color:var(--muted);pointer-events:none}
.lc-kbd{position:absolute;right:8px;min-width:18px;height:18px;display:grid;place-items:center;border:1px solid var(--line-2);border-radius:4px;font:500 11px var(--f-mono);color:var(--muted);background:var(--surface);pointer-events:none}
.lc-search-wrap:focus-within .lc-kbd{display:none}
.shell .chip .n,.shell .view-tab .n{font:500 11px var(--f-mono);color:var(--muted);margin-left:2px}
.chip-dot{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:6px;background:var(--idle);vertical-align:1px}
.chip-dot.working{background:var(--working)}.chip-dot.review{background:var(--review)}.chip-dot.done{background:var(--done)}.chip-dot.idle{background:var(--ink-2)}

.lc-viewtabs{display:flex;align-items:flex-end;gap:4px;border-bottom:1px solid var(--line);margin:0 0 16px;flex-wrap:wrap}
.view-tab{display:inline-flex;align-items:center;gap:4px;padding:8px 12px 10px;line-height:20px;font:500 13.5px var(--f-ui);color:var(--muted);text-decoration:none;border-bottom:2px solid transparent;margin-bottom:-1px}
.view-tab:hover{color:var(--ink)}
.view-tab.selected{color:var(--ink);border-bottom-color:var(--ink)}
.lc-viewtabs .views-bar{display:contents}
.lc-viewtabs .views-bar>.muted{display:none}
.lc-viewtabs .view-chip{border:0;border-bottom:2px solid transparent;border-radius:0;background:none;padding:8px 6px 10px 12px;margin-bottom:-1px;font:500 13.5px var(--f-ui)}
.lc-viewtabs .view-chip a{color:var(--muted)}.lc-viewtabs .view-chip:hover a{color:var(--ink)}
.lc-viewtabs .view-chip.selected{background:none;border-bottom-color:var(--ink)}.lc-viewtabs .view-chip.selected a{color:var(--ink)}
.lc-viewtabs .view-chip .icon{opacity:0;color:var(--muted)}.lc-viewtabs .view-chip:hover .icon,.lc-viewtabs .view-chip .icon:focus-visible{opacity:1}
.lc-viewtabs .link-button{margin:0 0 -1px;border-bottom:2px solid transparent;line-height:20px;padding:8px 12px 10px;font:400 13.5px var(--f-ui);color:var(--muted);text-decoration:none}
.lc-viewtabs .view-save{display:inline-flex;gap:6px;align-items:center;padding-bottom:6px}

.ads-list{gap:0}  /* the list sets its own rhythm; .ads spaces other ad pages by 20 px */
.ads-list .lc-bar{margin:0 0 12px;gap:8px}
.ads-list .lc-bar select{-webkit-appearance:none;appearance:none;border-radius:999px;min-height:32px!important;height:32px!important;padding:0 28px 0 12px;font-size:12.5px;width:auto;
  background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);
  background-position:right 15px center,right 11px center;background-size:4px 4px,4px 4px;background-repeat:no-repeat}  /* a drawn chevron: the CSP allows no data: images */
.ads-list .lc-bar select.lc-sort{margin-left:auto;border-color:transparent;background-color:transparent;font-weight:500}
.ads-list .lc-bar select.lc-sort:hover{background-color:var(--hover)}
.lc-filters{display:flex;flex-wrap:wrap;align-items:center;gap:8px 24px;margin:0 0 16px}
.lc-filters .lc-tabs,.lc-filters .ad-chips{border:0;margin:0;padding:0;gap:6px;flex-wrap:wrap}

.ads-list .ad-list{border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:none;overflow:visible}  /* a row menu opens past the table's edge */
.ads-list .lc-table th:first-child{border-top-left-radius:11px}.ads-list .lc-table th:last-child{border-top-right-radius:11px}
.ads-list .lc-table th{font:500 11px var(--f-mono);letter-spacing:.06em;color:var(--muted);background:var(--sunk);padding:10px 12px}
.ads-list .lc-table td{padding:12px;border-bottom:1px solid var(--line)}
.ads-list .lc-table tr.is-picked{background:var(--accent-soft)}
.lc-thumb{width:auto}
.lc-strip{display:flex;gap:4px}
.lc-strip img{width:40px;height:56px;object-fit:cover;border-radius:5px;background:var(--sunk);display:block}
.lc-pill{display:inline-flex;align-items:center;gap:6px;padding:2px 10px;border-radius:999px;font:500 12.5px var(--f-ui);background:var(--sunk);color:var(--ink-2);white-space:nowrap}
.lc-pill i{width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}
.lc-pill.working{background:var(--info-soft);color:var(--info)}
.lc-pill.review{background:var(--review-soft);color:var(--review)}
.lc-pill.done{background:var(--accent-soft);color:var(--accent)}
.lc-pill.idle{background:var(--sunk);color:var(--ink-2)}
.lc-prog{min-width:150px}
.lc-prog small{display:block;margin-top:5px;font-size:12px}
.lc-bar-track{display:flex;height:4px;border-radius:2px;background:var(--sunk);overflow:hidden;max-width:150px}
.lc-bar-track i{display:block;height:100%}
.lc-bar-track i.done{background:var(--accent)}.lc-bar-track i.working{background:var(--info)}
.lc-menu{position:relative;display:inline-block}
.lc-menu>summary{list-style:none;cursor:pointer;width:28px;height:28px;display:grid;place-items:center;border-radius:6px;color:var(--muted);font-size:16px;line-height:1}
.lc-menu>summary::-webkit-details-marker{display:none}
.lc-menu>summary:hover,.lc-menu[open]>summary{background:var(--hover);color:var(--ink)}
.lc-menu-list{position:absolute;right:0;top:calc(100% + 4px);z-index:30;min-width:180px;display:flex;flex-direction:column;padding:4px;background:var(--raised);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow)}
.shell .ads-list .lc-menu-list button{all:unset;box-sizing:border-box;padding:7px 10px;border-radius:6px;font:400 13px var(--f-ui);color:var(--ink);cursor:pointer;text-align:left}
.shell .ads-list .lc-menu-list button:hover,.shell .lc-menu-list button:focus-visible{background:var(--hover)}
.shell .ads-list .lc-menu-list button.danger-text{color:var(--danger)}
.shell .ads-list .lc-menu-list button:disabled{opacity:.5;cursor:default}

.ads-list .lc-bulk{position:fixed;left:calc(232px + (100vw - 232px) / 2);transform:translateX(-50%);bottom:20px;top:auto;z-index:40;margin:0;max-width:calc(100vw - 232px - 48px);
  padding:8px 10px 8px 16px;border:0;border-radius:12px;background:var(--ink);color:var(--surface);box-shadow:var(--shadow-lg);gap:8px;flex-wrap:nowrap;width:max-content}
.ads-list .lc-bulk b{font-weight:600;margin-right:4px}
.shell .ads-list .lc-bulk button,.shell .ads-list .lc-bulk select,.shell .ads-list .lc-bulk input{background:transparent!important;color:var(--surface)!important;border:1px solid color-mix(in srgb,var(--surface) 28%,transparent)!important;min-height:30px!important;height:30px!important;width:auto;flex:none}  /* beats the shell's field rule */
.shell .ads-list .lc-bulk input::placeholder{color:color-mix(in srgb,var(--surface) 60%,transparent)}
.shell .ads-list .lc-bulk select option{color:var(--ink);background:var(--surface)}
.shell .ads-list .lc-bulk button:hover{background:color-mix(in srgb,var(--surface) 12%,transparent)}
.shell .ads-list .lc-bulk .danger{color:var(--danger-soft);border-color:var(--danger)}
.shell .ads-list .lc-bulk input{width:150px}
.ads-list:has(.lc-bulk) .lc-foot{padding-bottom:64px}

.empty-state{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:56px 24px}
.empty-state .empty-ic{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:var(--sunk);color:var(--muted);margin-bottom:6px}
.empty-state .empty-ic svg{width:20px;height:20px}
.empty-state h3{margin:0;font:600 15px var(--f-ui);color:var(--ink)}
.empty-state p{margin:0 0 8px;max-width:46ch;font-size:13.5px;color:var(--muted);text-wrap:pretty}

/* ---- Brand kits (visual PR B, hi-fi screen 2): brand tabs, search with section pills, one five-column card grid ---- */
.ads-kit{gap:16px}.shell>main>.ads-kit>.ad-head:first-child{margin-bottom:8px}
.kit-bar{flex-wrap:wrap;margin:0}
.kit-bar .ad-chips{gap:6px}
.kit-cards{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px;margin:0 0 24px}
@media (max-width:1180px){.kit-cards{grid-template-columns:repeat(4,minmax(0,1fr))}}
.kit-card{display:flex;flex-direction:column;gap:0;border:1px solid var(--line);border-radius:12px;background:var(--surface);overflow:hidden}
.kit-card.is-open .ad-img{outline:0}
.kit-card .ad-img{position:relative;display:block;aspect-ratio:1/0.92;background:var(--sunk);border-radius:0}
.kit-card .ad-img img{width:100%;height:100%;object-fit:cover;display:block;border-radius:0}
.kit-lock{position:absolute;top:8px;right:8px;display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:5px;background:rgba(20,26,23,.72);color:#fff;font:500 11.5px var(--f-ui)}
.kit-lock svg{width:11px;height:11px}
.kit-body{display:flex;flex-direction:column;gap:8px;padding:12px 12px 10px;flex:1;min-width:0}
.kit-body>b{font:500 14px var(--f-ui);color:var(--ink)}
.kit-pills{display:flex;flex-wrap:wrap;gap:4px}
.kit-pill{display:inline-flex;align-items:center;padding:2px 8px;border-radius:6px;background:var(--sunk);font:400 12.5px var(--f-ui);color:var(--ink-2)}
.kit-body .status{align-self:flex-start}
.kit-body .row{gap:6px;flex-wrap:wrap}
.kit-foot{border-top:1px solid var(--line);padding:9px 12px;margin:0}
.kit-foot .link-button{color:var(--muted);text-decoration:none;font-size:12.5px}
.kit-foot .link-button:hover{color:var(--ink)}
.kit-new-card{all:unset;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:260px;border:1.5px dashed var(--line-2);border-radius:12px;color:var(--muted);cursor:pointer;text-align:center;padding:16px}
.kit-new-card>span{font-size:22px;line-height:1}
.kit-new-card b{font:500 13.5px var(--f-ui);color:var(--ink-2)}
.kit-new-card small{font-size:12px}
.kit-new-card:hover,.kit-new-card:focus-visible{border-color:var(--accent);color:var(--accent)}
.ads-kit>.lc-tabs{margin:0}
.ads-kit .lc-tabs .tab{padding:8px 12px 10px;font-size:13.5px}
.ads-kit .lc-tabs .tab.selected{border-bottom-color:var(--ink)}

/* ---- dialogs, confirms, toasts and loading (visual PR C, hi-fi screens 4 and 5) ---- */
/* the redraw dialog: a short header with the engine pill, one compact row a frame, a pinned footer */
#dialog:has(.fc-dlg){padding:0;width:min(760px,calc(100vw - 48px));max-width:none;max-height:calc(100vh - 64px);overflow:hidden}
#dialog:has(.fc-dlg)>#close-dialog{display:none}
.fc-dlg{display:flex;flex-direction:column;max-height:calc(100vh - 64px)}
.fc-dlg-head{display:flex;align-items:flex-start;gap:16px;padding:20px 24px 16px;border-bottom:1px solid var(--line)}
.fc-dlg-head>div{flex:1;min-width:0}
.fc-dlg-head h2{margin:0 0 4px!important;font:600 17px/24px var(--f-ui)!important}
.fc-dlg-head p{margin:0;font-size:13px}
.fc-dlg-pill{flex:none;padding:3px 10px;border-radius:999px;background:var(--sunk);font:500 12px var(--f-ui);color:var(--ink-2)}
.fc-dlg-gaps{margin:12px 24px 0}
.fc-dlg .fc-dialog{margin:0;max-height:none;flex:1;min-height:0;overflow:auto;gap:0}
.fc-dlg .fc-frame{grid-template-columns:92px minmax(0,1fr);gap:16px;padding:16px 24px;border-top:1px solid var(--line)}
.fc-dlg .fc-frame:first-child{border-top:0;padding-top:16px}
.fc-thumb{display:block;width:92px;aspect-ratio:9/16;object-fit:cover;border-radius:8px;background:var(--sunk)}
.fc-frame-title{margin:0;display:flex;flex-wrap:wrap;align-items:center;gap:6px;font:600 14.5px/22px var(--f-ui)}
.fc-pill{padding:1px 8px;border-radius:999px;background:var(--review-soft);color:var(--review);font:500 12px/20px var(--f-ui)}
.fc-problem{margin:0;font-size:13.5px;line-height:1.5;color:var(--ink-2)}
.fc-why-line{margin:0;font-size:12.5px}
.fc-dlg .fc-prompt textarea{min-height:0;height:calc(3 * 1.6em + 22px);font:400 13px/1.6 var(--f-mono);padding:10px 12px;border:1px solid var(--line-2);border-radius:8px;background:var(--sunk);color:var(--ink);resize:vertical}
.fc-dlg .fc-prompt textarea:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft);background:var(--surface)}
.fc-dlg-total{flex:1;min-width:0}
.fc-dlg-foot button{flex:none;white-space:nowrap}
.fc-dlg-foot{display:flex;align-items:center;gap:8px;padding:14px 24px;border-top:1px solid var(--line);background:var(--sunk);font-size:13px}
.fc-dlg-foot button,.dlg-actions button{min-height:34px;padding-inline:14px;border-radius:8px;font:500 13px var(--f-ui)}

/* a confirm: the title, what goes / stays / how to get it back, the buttons on the right */
#dialog:has(.dlg-ask){width:min(560px,calc(100vw - 48px));padding:24px}
.dlg-ask h2{margin:0 0 16px!important;font:600 17px/24px var(--f-ui)!important}
.dlg-ask>p{margin:0;font-size:13.5px;color:var(--ink-2)}
.dlg-rows{display:grid;grid-template-columns:110px minmax(0,1fr);gap:8px 16px;margin:0;font-size:13.5px}
.dlg-rows dt{color:var(--muted)}.dlg-rows dd{margin:0;color:var(--ink)}
.dlg-actions{justify-content:flex-end;gap:8px;margin-top:24px!important}
.dlg-actions button.danger{background:var(--danger);border-color:var(--danger);color:var(--danger-ink)}
.dlg-actions button.danger:hover{filter:brightness(1.06)}

/* a toast: an icon for its tone, the text and one link */
#toast.show{display:flex;align-items:center;gap:10px}
#toast{padding:11px 16px;border:0;background:var(--ink);color:var(--surface)}
#toast .toast-ic{width:15px;height:15px;flex:none;opacity:.85}
#toast .toast-t{flex:1;min-width:0}
#toast a{flex:none;color:var(--accent-line);font-weight:500;text-decoration:none}

/* opening a project: a skeleton card instead of a large dashed box */
.skel-card{display:flex;flex-direction:column;gap:12px;max-width:576px;padding:22px 24px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.skel-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:6px}
.skel-head h1{margin:0;font:600 14.5px/22px var(--f-ui)!important;letter-spacing:0!important}
.skel-note{font:400 12px var(--f-mono);color:var(--muted)}
.skel-line{display:block;height:12px;border-radius:6px;background:var(--line)}
.skel-line.w60{width:66%}.skel-line.w90{width:88%}.skel-line.w45{width:52%}
.skel-tiles{display:flex;gap:6px;margin-top:8px}
.skel-tiles i{width:44px;height:62px;border-radius:6px;background:var(--line)}
@media (prefers-reduced-motion:no-preference){.skel-line,.skel-tiles i{animation:skel-pulse 1.4s ease-in-out infinite}}
@keyframes skel-pulse{50%{opacity:.55}}

/* the vault's Edit script text box: tall, as its inline style (dropped by the CSP) meant it to be */
.vault-edit-tall{min-height:45vh}

/* ---- the ad editor (visual PR C2, hi-fi screen 3): an icon sidebar, one header bar, a scene rail, the scene card
   with a segmented step control and a shot strip, and a Checks rail. Ads only; shorts keep their layout. ---- */
.shell.is-ad-editor{margin-left:64px}
.sidebar:has(+ .shell.is-ad-editor){width:64px;padding:14px 10px}
.sidebar:has(+ .shell.is-ad-editor) .brand{font-size:0;gap:0;justify-content:center;padding:4px 0 14px}
.sidebar:has(+ .shell.is-ad-editor) .nav-section{height:1px;padding:0;margin:10px 6px;background:var(--line);overflow:hidden;color:transparent}
.sidebar:has(+ .shell.is-ad-editor) nav a{justify-content:center;padding:8px 0}
.sidebar:has(+ .shell.is-ad-editor) nav a .nav-t,.sidebar:has(+ .shell.is-ad-editor) nav a .nav-n,.sidebar:has(+ .shell.is-ad-editor) .footer p,.sidebar:has(+ .shell.is-ad-editor) .footer .pill{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.sidebar:has(+ .shell.is-ad-editor) .footer{justify-content:center;padding:10px 0 2px}
.is-ad-editor>main{--main-x:24px;padding-left:24px!important;padding-right:24px!important}

/* one header bar: crumb and title, the steps, then the spend and Project details */
.is-ad-editor>main{padding-top:0!important}
.is-ad-editor .pw-head{position:sticky;top:0;z-index:20;display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:12px;min-height:56px;margin:0 -24px 16px;padding:8px 24px;background:var(--surface);border-bottom:1px solid var(--line)}
.is-ad-editor .pw-head-row{display:contents}
.is-ad-editor .pw-head .pw-crumbs{order:0;display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:13.5px}
.is-ad-editor .pw-head>.pw-head-row>.pw-crumb-sep{order:0}
.is-ad-editor .pw-head h1.pw-title{order:0;min-width:0;max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:600 13.5px/20px var(--f-ui)!important}
.is-ad-editor .pw-head .status-pill{order:0;white-space:nowrap}
.is-ad-editor .pw-head .pw-sub{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.is-ad-editor .pw-head .pw-steps{order:1;flex-wrap:nowrap;gap:4px;margin-left:12px}
.is-ad-editor .pw-head .pw-grow{order:2;flex:1}
.is-ad-editor .pw-head .pw-spend,.is-ad-editor .pw-head-row>.quiet,.is-ad-editor .pw-head-row>button,.is-ad-editor .pw-head-row>a{order:3;white-space:nowrap}
.is-ad-editor .pw-head .pw-spend{font:400 12.5px var(--f-mono);color:var(--muted)}
.is-ad-editor .pw-steps button.pw-step{flex-direction:row;align-items:center;padding:5px 12px;border:0;border-radius:8px;min-height:32px}
.is-ad-editor .pw-steps button.pw-step.active{background:var(--hover);color:var(--ink)}
.is-ad-editor .pw-steps .pw-step b{font:400 13.5px var(--f-ui);white-space:nowrap}
.is-ad-editor .pw-steps .pw-step.active b{font-weight:500}
.is-ad-editor .pw-steps .pw-step:has(.pw-step-status.done) b::before{content:"✓";display:inline-grid;place-items:center;width:16px;height:16px;margin-right:6px;border-radius:50%;background:var(--accent);color:var(--accent-ink);font-size:10px;vertical-align:1px}
.is-ad-editor .pw-steps .pw-step-status{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}  /* the step's state stays in its title and for screen readers */

/* three columns: the scene rail, the scene, the Checks rail */
.pw-clipgrid.pw-ad{display:grid;grid-template-columns:220px minmax(0,1fr) 300px;gap:20px;align-items:start;flex-wrap:nowrap}
.pw-ad>.pw-cliplist{max-width:none;position:sticky;top:72px;max-height:calc(100vh - 160px);overflow:auto}
.pw-ad>.pw-middle{min-width:0}
.pw-ad .pw-middle>.pw-side{max-width:none;margin-top:16px}
.pw-clip.has-rail{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:10px;padding:8px;text-align:left;width:100%}
.pw-clip.has-rail.selected{padding:7px}
.pw-clip-thumb{position:relative;flex:none;width:44px;height:62px;border-radius:6px;background:var(--sunk);overflow:hidden}
.pw-clip-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.pw-clip-thumb i{position:absolute;left:4px;bottom:3px;font:500 10.5px var(--f-mono);font-style:normal;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.6)}
.pw-clip-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.pw-clip-text .muted{font:400 12px var(--f-mono)}
.pw-clip-text .status{font-size:12px!important;font-weight:500!important}
.pw-pips{display:flex;gap:3px;margin-top:3px}
.pw-pips i{width:18px;height:3px;border-radius:2px;background:var(--line-2)}
.pw-pips i.done{background:var(--accent)}.pw-pips i.attention{background:var(--review)}.pw-pips i.working,.pw-pips i.next{background:var(--info)}

.pw-checks{position:sticky;top:72px;max-height:calc(100vh - 160px);overflow:auto;display:flex;flex-direction:column;gap:10px;min-width:0}
.pw-checks-head{display:flex;align-items:center;gap:8px;padding:2px 2px 4px}
.pw-checks-head strong{font:600 15px var(--f-ui)}
.pw-checks-n{padding:1px 8px;border-radius:999px;background:var(--review-soft);color:var(--review);font:500 12px/20px var(--f-ui)}
.pw-checks-body{display:flex;flex-direction:column;gap:10px}
.pw-checks-body>.panel,.pw-checks-body>.review-banner{margin:0;padding:12px 14px;flex-direction:column;align-items:stretch;gap:8px;font-size:13px;min-height:0;height:auto}
.pw-checks-body>.panel>.grow{flex:none}
.pw-checks-body>.review-banner p{margin:0}
.pw-checks-body>.panel .row{flex-wrap:wrap;gap:6px}
.pw-checks-body .flag-card{font-size:13px}
.pw-checks-body .fc-flags,.pw-checks-body .sg-box,.pw-checks-body section.pc{margin:0}

/* the scene card: a segmented step control that shows one section at a time */
.scene-steps.is-seg{display:flex;gap:2px;padding:3px;border-radius:10px;background:var(--sunk);border:1px solid var(--line)}
.scene-steps.is-seg .scene-step{flex:1;padding:0;border:0;background:transparent}
.scene-steps.is-seg .scene-seg{all:unset;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:8px 12px;border-radius:8px;cursor:pointer;font-size:13px}
.scene-steps.is-seg .scene-seg[aria-pressed="true"]{background:var(--surface);box-shadow:0 1px 2px rgba(0,0,0,.08)}
.scene-steps.is-seg .scene-seg:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.scene-steps.is-seg .ad-label{flex:none;white-space:nowrap;font:500 13px var(--f-ui);color:var(--ink);text-transform:none;letter-spacing:0}
.scene-steps.is-seg .scene-step-state{font-size:12px;text-align:right;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sbx[data-seg="frame"]>.sbx-step:not(.is-frame),.sbx[data-seg="prompt"]>.sbx-step:not(.is-prompt),.sbx[data-seg="video"]>.sbx-step:not(.is-video){display:none}

/* the shot strip over the shot rows */
.sbx .sp-strip{display:flex;margin:8px 0 10px;border:1px solid var(--line);border-radius:6px;overflow:hidden;background:var(--surface)}
.sbx .sp-strip-seg{min-width:0;padding:5px 8px;border-left:1px solid var(--line);font:400 11.5px var(--f-mono);color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sbx .sp-strip-seg:first-child{border-left:0}
.sbx .sp-strip-seg b{font-weight:500;color:var(--ink-2)}
.sbx .sp-strip-seg.is-talk{background:var(--accent-soft);color:var(--accent)}

/* unsaved changes stay in view, just above the page footer */
.sp-unsaved-host{display:contents}  /* so the bar sticks within the whole scene card */
.is-ad-editor .sp-unsaved{position:sticky;top:64px;z-index:5;margin:8px 0;box-shadow:var(--shadow)}
/* the page footer spans the editor's own 24 px gutter (not the 40 px of other pages), so nothing scrolls sideways */
.is-ad-editor .pw-foot{margin-left:-24px;margin-right:-24px;padding-left:24px;padding-right:24px}

/* ---- polish pass 1 (Reed, 2026-10-22: "clean and professional UI throughout"): the project page ---- */
/* clip rail: every card fills the rail, so its edges line up with the search and chips above; the selected card keeps
   the same box (its accent is an inset ring, not a thicker border) */
.pw-cliplist-items{display:flex;flex-direction:column;gap:8px}
.pw-cliplist-items>.label{margin:0}
button.pw-clip{width:100%;box-sizing:border-box}
button.pw-clip.selected{border:1px solid var(--done);padding:12px;box-shadow:inset 0 0 0 1px var(--done)}
button.pw-clip.has-rail.selected{padding:8px}

/* banners above the columns: one card style for the saved-cast note and the review status */
#main:has(>.pw-head) .library-hint{margin:0 0 12px;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink-2);font-size:13px;line-height:1.5;max-width:none}
#main:has(>.pw-head) .review-banner{font-size:13.5px}

/* shot-sheet notes (split / move the split): the flag-card look, no bullets, body text in ink */
ul.note.seam-notes{list-style:none;margin:12px 20px;padding:12px 14px;border:1px solid var(--review-line);border-radius:10px;background:var(--surface);color:var(--ink);font-size:13px;line-height:1.5}
ul.note.seam-notes li{padding-left:0}
ul.note.seam-notes li+li{margin-top:10px;padding-top:10px;border-top:1px solid var(--line)}
ul.note.seam-notes .row{gap:8px}

/* video players: no focus box on a mouse click; a keyboard focus ring stays */
.shell video:focus:not(:focus-visible){outline:none}
.shell video:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* the Length control: a short number box with its unit and button on one line */
.clip-length .row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0}
.clip-length .row>label{margin:0;font-weight:600;font-size:13px}
.shell .clip-length input[type=number]{width:88px;flex:none}
.clip-length .row>small{flex-basis:100%;line-height:1.5}

/* the scene's middle column: the shot sheet and its Video card 16 px apart, like every other stack */
.pw-video-cards>*,.pw-video-cards .project-video-take{margin-top:0}
.pw-middle>.pw-sheet{margin-bottom:0}
.project-video-panel p{font-size:13px;line-height:1.5}

/* Your video: one button size, rows that wrap evenly, a plain "Finished editing" card, an inline checkbox */
.project-video-panel button,.project-video-panel a.button{min-height:32px;padding:0 12px;border-radius:8px;font:500 13px var(--f-ui)}
.project-video-panel .row{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.project-video-panel .video-done{margin-top:16px;padding:0;border:0;background:none;box-shadow:none}
.project-video-panel .completion-bar{margin:0;padding:14px 16px;border:1px solid var(--line);border-left:1px solid var(--line);border-radius:10px;background:var(--sunk);box-shadow:none;gap:10px}
.project-video-panel .completion-bar strong{font-size:14px}
.project-video-panel .completion-bar .primary{font-size:13px;padding:0 14px;min-height:32px}
.video-full .video-trim{align-items:center;gap:8px;font-size:13.5px}
.video-full .video-trim label,.video-full .video-trim strong{font-weight:500}
.video-full .video-trim input[type=checkbox]{width:16px;height:16px;margin:0}

/* the page footer: its status wraps instead of clipping, and its height is reserved, so a focused or scrolled-to
   control is never under it */
.pw-foot-status{flex:1 1 200px;min-width:0;white-space:normal;line-height:1.4}
html:has(#main>.pw-foot){scroll-padding-bottom:88px}
html:has(.background-task-tray){scroll-padding-bottom:110px}
html:has(#main>.pw-foot):has(.background-task-tray){scroll-padding-bottom:176px}
/* the footer meets the window's bottom edge at the end of the page (#main's general 160 px bottom padding left an
   80 px strip under it); with the task tray open, a spacer above the footer keeps the last content clear of it */
#main:has(>.pw-foot){padding-bottom:80px}
#main:has(>.pw-foot)>.pw-foot{order:100}
body:has(.background-task-tray) #main:has(>.pw-foot)::after{content:"";order:99;flex:none;height:96px}
.pw-cliplist{max-height:calc(100vh - 140px - 88px);overflow:auto}
/* the ad editor's Checks rail sits on the right, where the task tray floats: it stops above the tray */
body:has(.background-task-tray) .pw-checks{max-height:calc(100vh - 72px - 88px - 96px)}

/* ---- polish pass 2 (Reed, 2026-10-22): the same rules on every page ---- */
/* Projects: search, Assigned to, Tag, Sort by and Refresh on one row at the control sizes; folder and status filters
   as the pill chips the Ads list uses, with mono counts */
@media (min-width:1100px){.workspace-toolbar{grid-template-columns:minmax(220px,1.8fr) repeat(3,minmax(140px,1fr)) auto}}
.workspace-toolbar input,.workspace-toolbar select{height:34px}
.workspace-toolbar>button{height:34px;align-self:end}
.workspace-filters{gap:6px;margin:0 0 16px}
.shell .workspace-filters button{min-height:28px;padding:3px 10px;border:1px solid var(--line-2);border-radius:999px;background:var(--surface);color:var(--ink-2);font:400 12.5px var(--f-ui)}
.shell .workspace-filters button.selected,.shell .workspace-filters button[aria-pressed="true"]{border-color:var(--ink);background:var(--hover);color:var(--ink)}
.workspace-filters .count,.lib-tabs .count{margin-left:6px;font:500 11px var(--f-mono);color:var(--muted)}
.project-tabs{border-bottom:0;padding-bottom:0;margin-bottom:8px}

/* Library and Cast: tabs as pill chips with spaced counts; hints as one quiet card style */
.shell .lib-tabs a,.shell .lib-tabs button{min-height:28px;padding:3px 12px;border-radius:999px;border:1px solid var(--line-2);background:var(--surface);color:var(--ink-2);font:400 12.5px var(--f-ui)}
.shell .lib-tabs a.active,.shell .lib-tabs button.active{border-color:var(--ink);background:var(--hover);color:var(--ink)}
.library-hint{margin:0 0 16px;padding:10px 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink-2);font-size:13px;line-height:1.5;max-width:none}

/* empty states: the buttons centred under the centred text, spaced by the row's gap only */
.empty .row{justify-content:center;gap:8px}
.empty .row>*{margin:0}
.empty>button,.empty>a.button,.empty>.row{margin-top:14px}

/* the vault and Drafts tabs: counts in mono, one space from the label */
#script-vault-page .vault-tabs .vault-badge{font:500 11px var(--f-mono)!important;color:var(--muted)!important}
#script-vault-page .vault-tabs>.active .vault-badge{color:inherit!important}

/* Settings: a panel's own button keeps its width instead of stretching across the card */
.stack>button,.stack>a.button{justify-self:start}

/* New ad: the top bar like every other page; the form below keeps its reading width */
.ads.ad-form{max-width:none}
.ads.ad-form>:not(.ad-head){max-width:820px}
.shell>main>.ads>.ad-head:first-child .ad-step{font:400 13px var(--f-ui);letter-spacing:0;text-transform:none}
