/* Breakdown pass (Nov 2026): the breakdown happens in the script.
   Suggestions are underlined in the page, confirmed items sit in one list,
   fields save themselves, and finishing a scene moves you to the next. */

/* ---- Script: suggestions underlined, tags highlighted, both hover-linked ---- */
.bd2-paper .bd2-suggest{
  padding:0 1px;border-radius:2px;cursor:pointer;
  text-decoration:underline dotted color-mix(in srgb,var(--bd2-tone) 85%,#6b6457);text-decoration-thickness:1.5px;text-underline-offset:3px;
  transition:background 140ms ease,text-decoration-color 140ms ease;
}
.bd2-paper .bd2-suggest:hover,.bd2-paper .bd2-suggest:focus-visible,.bd2-paper .bd2-suggest.bd2-linked{
  background:color-mix(in srgb,var(--bd2-tone) 32%,transparent);text-decoration-color:transparent;outline:none;
}
.bd2-paper mark.bd2-linked{background:color-mix(in srgb,var(--bd2-tone) 55%,transparent);box-shadow:0 0 0 2px color-mix(in srgb,var(--bd2-tone) 45%,transparent);}
.bd2-paper mark.bd2-just-tagged{animation:bd2-just-tagged 520ms cubic-bezier(.2,.8,.2,1);}
@keyframes bd2-just-tagged{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--bd2-tone) 70%,transparent);background:color-mix(in srgb,var(--bd2-tone) 70%,transparent);}100%{box-shadow:0 0 0 8px transparent;background:color-mix(in srgb,var(--bd2-tone) 25%,transparent);}}
body.bd2-active #bd2Script .bd2-reconnect-banner~.bd2-paper .bd2-suggest{text-decoration:none;cursor:text;}

/* Turning to the next scene after marking one done. */
#bd2Script.bd2-turn-next .bd2-paper{animation:bd2-turn-next 340ms cubic-bezier(.2,.7,.2,1);}
#bd2Script.bd2-turn-prev .bd2-paper{animation:bd2-turn-prev 340ms cubic-bezier(.2,.7,.2,1);}
@keyframes bd2-turn-next{from{opacity:.15;transform:translateX(36px);}to{opacity:1;transform:none;}}
@keyframes bd2-turn-prev{from{opacity:.15;transform:translateX(-36px);}to{opacity:1;transform:none;}}

/* ---- Toolbar: eighths after the heading ---- */
.bd2-toolbar-title .bd2-eighths{color:var(--dim);font-variant-numeric:tabular-nums;}
.bd2-toolbar-title .bd2-eighths::before{content:'·';margin-right:8px;}

/* ---- Inspector: one list, and one field at the top that finds or adds. ----
   Typing filters the scene's items; Enter (or the +) opens Add with what was typed. The old
   "In This Scene" label, the Add Item button and the separate search dock are this one control. */
.bd2-inspector-heading{justify-content:space-between;gap:8px;padding:0 12px 0 16px;}
.bd2-inspector-title{position:relative;top:0;}
.bd2-find{position:relative;display:flex;align-items:center;flex:1;min-width:0;}
.bd2-find[hidden]{display:none;}
.bd2-find>svg{position:absolute;left:9px;width:13px;height:13px;fill:none;stroke:var(--dim);stroke-width:1.7;stroke-linecap:round;pointer-events:none;transition:stroke 140ms ease;}
.bd2-find:focus-within>svg,.bd2-find.is-filtering>svg{stroke:var(--text);}
body.studio-refined .bd2-find .bd2-find-input{padding-left:28px;padding-right:30px;border-color:transparent;background:var(--surface-1,var(--surface-0));}
body.studio-refined .bd2-find .bd2-find-input:hover{border-color:var(--line-soft);}
body.studio-refined .bd2-find .bd2-find-input:focus{border-color:var(--icon-mint);outline:none;}
.bd2-find .bd2-find-input::-webkit-search-cancel-button,.bd2-find .bd2-find-input::-webkit-search-decoration{appearance:none;display:none;}
body.studio-refined .bd2-find .bd2-find-add{position:absolute;right:3px;width:22px;height:22px;min-height:0;padding:0;border:0;border-radius:4px;background:none;}
body.studio-refined .bd2-find .bd2-find-add:hover{background:var(--surface-3);}
body.studio-refined .bd2-find .bd2-find-add:disabled{opacity:.3;}
.bd2-find .bd2-find-add svg{width:14px;height:14px;}
.bd2-items-scroll{padding-top:2px;}
.bd2-card.bd2-linked{border-color:color-mix(in srgb,var(--bd2-tone) 70%,var(--line));box-shadow:0 0 0 1px color-mix(in srgb,var(--bd2-tone) 45%,transparent);}
.bd2-empty-quiet{padding:4px 2px 12px;text-align:left;font-size:11px;line-height:16px;}

/* Cast, read from the script. */
body.studio-refined .bd2-cast-row{
  box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:32px;margin:0 0 4px;padding:4px 8px 4px 10px;
  border:1px solid var(--line-soft);border-radius:6px;background:color-mix(in srgb,var(--panel) 70%,transparent);color:var(--text);font:500 12px/18px var(--sans);text-align:left;cursor:pointer;
}
body.studio-refined .bd2-cast-row:hover{background:var(--surface-2);border-color:var(--line);}
.bd2-cast-row .bd2-cast-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.bd2-cast-row .bd2-cast-state{flex:none;color:var(--dim);font:500 10px/16px var(--sans);letter-spacing:.02em;}
.bd2-cast-row.is-set .bd2-cast-state{color:var(--icon-mint);}
.bd2-cast-row.is-voice .bd2-cast-state{color:var(--icon-gold);}
.bd2-cast-row.is-mentioned,.bd2-cast-row.is-out{color:var(--dim);}
.bd2-cast-row.is-out .bd2-cast-name{text-decoration:line-through;text-decoration-color:color-mix(in srgb,var(--dim) 60%,transparent);}
.bd2-cast-row.is-override .bd2-cast-state::after{content:' ·';color:var(--icon-gold);}

/* Suggested items: quiet dashed rows under the confirmed ones. */
.bd2-suggested h3{display:flex;align-items:center;gap:6px;}
.bd2-suggested h3 .bd2-category-toggle{flex:1;width:auto;}
.bd2-suggest-row{
  box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr) auto 28px;align-items:center;gap:4px;min-height:34px;margin:0 0 4px;padding:2px 2px 2px 2px;
  border:1px dashed color-mix(in srgb,var(--bd2-tone) 34%,var(--line));border-radius:6px;background:color-mix(in srgb,var(--bd2-tone) 4%,transparent);transition:border-color 140ms ease,background 140ms ease;
}
.bd2-suggest-row:hover,.bd2-suggest-row.bd2-linked{border-color:color-mix(in srgb,var(--bd2-tone) 70%,var(--line));background:color-mix(in srgb,var(--bd2-tone) 10%,transparent);}
body.studio-refined .bd2-suggest-name{display:flex;align-items:baseline;gap:6px;width:100%;min-width:0;height:auto;min-height:28px;margin:0;padding:4px 6px;border:0;background:none;color:var(--text);font:500 12px/18px var(--sans);text-align:left;cursor:pointer;}
.bd2-suggest-name span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.bd2-suggest-name small{flex:none;color:var(--dim);font:400 10px/16px var(--sans);}
body.studio-refined .bd2-suggest-choose{height:22px;padding:0 8px;font-size:11px;}
body.studio-refined .bd2-small{height:22px;min-height:22px;padding:0 8px;font-size:11px;}
body.studio-refined .bd2-quiet{border-color:transparent;background:none;color:var(--dim);}
body.studio-refined .bd2-quiet:hover{background:var(--surface-2);color:var(--text);}

/* Item form: category + quantity on one line, notes, two folds. "Saved" breathes in when a change lands. */
.bd2-use-line{display:grid;grid-template-columns:minmax(0,1fr) 58px;gap:8px;align-items:center;margin:0 0 8px;}
.bd2-edit .bd2-qty{position:relative;display:block;gap:0;}
.bd2-edit .bd2-qty>i{position:absolute;left:9px;top:50%;translate:0 -50%;z-index:1;color:var(--dim);font:500 11px/18px var(--sans);font-style:normal;pointer-events:none;}
body.studio-refined .bd2-edit .bd2-qty>input{padding-left:20px;padding-right:6px;text-align:center;}
body.studio-refined .bd2-edit select.bd2-inline-category{font-weight:550;color:var(--text);}
.bd2-sourcing{display:grid;gap:8px;}
.bd2-sourcing:empty{display:none;}
.bd2-sourcing:not(:empty)::before{content:'Sourcing · every scene';display:block;margin:6px 0 -2px;color:var(--dim);font:500 10px/16px var(--sans);letter-spacing:.02em;}
.bd2-edit footer{min-height:28px;}
.bd2-saved{margin-left:auto;color:var(--icon-mint);font:500 10px/16px var(--sans);opacity:0;transition:opacity 220ms ease;}
.bd2-saved.is-on{opacity:1;}
.bd2-ready-field .bd2-button[aria-pressed=false]{color:var(--dim);}

/* Toast: one quiet line at the top of the list, always with Undo. */
.bd2-toast{padding:4px 2px 4px 8px;border:1px solid var(--line-soft);border-radius:6px;background:var(--surface-1);color:var(--text);animation:bd2-toast-in 220ms ease;}
@keyframes bd2-toast-in{from{opacity:0;transform:translateY(-4px);}to{opacity:1;transform:none;}}

/* ---- Sidebar: the progress line is a map of the script ----
   One segment per scene (mint = broken down, gold = needs another look, dim = not yet; the open scene is brighter).
   Hover names the scene, click opens it. The "8 of 18" count is a button: it goes to the next scene to break down. */
body.studio-refined #sidebar .bd2-scene-filter>#bd2SceneFilter{text-align:center;text-align-last:center;}
body.studio-refined.production-navigation #sidebar #bd2Scenes>summary{position:relative;overflow:hidden;}
/* Opening the list adds room below the progress marks; the title stays put. */
body.studio-refined.production-navigation #sidebar #bd2Scenes>summary{
  box-sizing:border-box;height:44px;padding-bottom:0;
  -webkit-user-select:none;user-select:none;
  transition:height 180ms ease,padding-bottom 180ms ease;
}
body.studio-refined.production-navigation #sidebar #bd2Scenes[open]>summary{height:56px;padding-bottom:12px;}
body.studio-refined.production-navigation #sidebar #bd2Scenes[open]>summary .bd2-progress{transform:translateY(4px);}
body.studio-refined.production-navigation #sidebar #bd2Scenes>summary .bd2-progress{
  position:absolute;left:12px;right:12px;top:28px;bottom:auto;display:flex;align-items:flex-end;gap:2px;height:10px;margin:0;padding:0;pointer-events:auto;cursor:default;
  transform:translateY(0);transition:transform 180ms ease;
}
@media(prefers-reduced-motion:reduce){body.studio-refined.production-navigation #sidebar #bd2Scenes>summary,body.studio-refined.production-navigation #sidebar #bd2Scenes>summary .bd2-progress{transition:none;}}
body.studio-refined.production-navigation #sidebar #bd2Scenes>summary .bd2-progress:is(:empty,[hidden]){display:none;}
body.studio-refined.production-navigation #sidebar #bd2Scenes>summary .bd2-progress>i{
  flex:1 1 0;min-width:1px;height:2px;border-radius:1px;background:color-mix(in srgb,var(--line) 85%,transparent);cursor:pointer;
  transition:height 120ms ease,background 200ms ease,opacity 200ms ease;
}
body.studio-refined.production-navigation #sidebar #bd2Scenes>summary .bd2-progress.bd2-strip-dense{gap:1px;}
body.studio-refined.production-navigation #sidebar #bd2Scenes>summary .bd2-progress>i.is-done{background:var(--icon-mint);}
body.studio-refined.production-navigation #sidebar #bd2Scenes>summary .bd2-progress>i.is-changed{background:var(--icon-gold);}
body.studio-refined.production-navigation #sidebar #bd2Scenes>summary .bd2-progress>i.is-open{height:4px;box-shadow:0 0 0 1px color-mix(in srgb,var(--text) 35%,transparent);}
body.studio-refined.production-navigation #sidebar #bd2Scenes>summary .bd2-progress>i.is-open.is-todo{background:color-mix(in srgb,var(--text) 55%,var(--line));}
body.studio-refined.production-navigation #sidebar #bd2Scenes>summary .bd2-progress>i:hover{height:5px;filter:brightness(1.25);}
body.studio-refined.production-navigation #sidebar #bd2Scenes>summary.bd2-all-reviewed .sidebarSectionCount{color:var(--icon-mint);}
body.studio-refined.production-navigation #sidebar #productionDrawer .bd2-count-jump{margin:0 -4px;padding:0 4px;border-radius:4px;cursor:pointer;transition:background 140ms ease,color 140ms ease;}
body.studio-refined.production-navigation #sidebar #productionDrawer .bd2-count-jump:hover:not(.is-idle){background:var(--surface-3);color:var(--text);}
body.studio-refined.production-navigation #sidebar #productionDrawer .bd2-count-jump:focus-visible{outline:1px solid var(--icon-mint);outline-offset:1px;}
body.studio-refined.production-navigation #sidebar #productionDrawer .bd2-count-jump.is-idle{cursor:default;}
/* Hover hints; reviewed is a filled mint square. */
body.studio-refined #sidebar #productionDrawer #insTabs #bd2SceneList .bd2-scene-row:hover .bd2-scene-check:not(.bd2-reviewed)>svg{opacity:.4;}
body.studio-refined #sidebar #productionDrawer #insTabs #bd2SceneList .bd2-scene-check:not(.bd2-reviewed):hover>svg{opacity:.85;}
body.studio-refined #sidebar #productionDrawer #insTabs #bd2SceneList .bd2-scene-check.bd2-reviewed{background:var(--icon-mint);color:#10211c;border-color:transparent;}
body.studio-refined #sidebar #productionDrawer #insTabs #bd2SceneList .bd2-scene-check.bd2-reviewed>svg{opacity:1;animation:bd2-pop 320ms cubic-bezier(.2,.8,.2,1);}
body.studio-refined #sidebar #productionDrawer #insTabs #bd2SceneList .bd2-scene-check.bd2-reviewed:hover{background:color-mix(in srgb,var(--icon-mint) 80%,#000);}
body.studio-refined #sidebar #productionDrawer #insTabs #bd2SceneList .bd2-scene-check[data-changed=true]{background:none;color:var(--icon-gold);}
@keyframes bd2-pop{0%{transform:scale(.5);}60%{transform:scale(1.18);}100%{transform:scale(1);}}

/* ---- Export: two one-click downloads, the rest under Options ---- */
.bd2-popover[data-kind=export]{width:300px;}
.bd2-report-quick{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
body.studio-refined .bd2-report-quick .bd2-button{flex-direction:column;align-items:flex-start;gap:0;height:auto;min-height:48px;padding:8px 10px;text-align:left;}
.bd2-report-quick .bd2-button small{display:block;color:var(--dim);font:400 10px/14px var(--sans);}
.bd2-export-options{display:block;}
.bd2-export-options>div{display:grid;gap:8px;}
.bd2-export-options summary{width:100%;box-sizing:border-box;}
.bd2-export-options summary{display:flex;align-items:center;justify-content:space-between;margin:0;min-height:28px;}
.bd2-export-options[open] summary{margin-bottom:8px;}
.bd2-export-options summary svg{width:12px;height:12px;transition:transform 160ms ease;}
.bd2-export-options[open] summary svg{transform:rotate(90deg);}

/* ---- Suggestion choice popover (an item with this name already exists) ---- */
.bd2-suggest-popover{width:280px;display:grid;gap:8px;}
.bd2-suggest-head{display:grid;gap:2px;}
.bd2-suggest-head b{font:550 13px/18px var(--sans);color:var(--text);}
.bd2-suggest-head small{color:var(--dim);font:400 10px/16px var(--sans);}
.bd2-suggest-popover .bd2-existing-matches .bd2-button{display:flex;justify-content:space-between;width:100%;}
.bd2-suggest-popover .bd2-existing-matches .bd2-button small{color:var(--dim);font:400 10px/16px var(--sans);}
.bd2-suggest-popover footer{display:flex;align-items:center;justify-content:space-between;gap:8px;}

@media(prefers-reduced-motion:reduce){
  .bd2-paper mark.bd2-just-tagged,#bd2Script.bd2-turn-next .bd2-paper,#bd2Script.bd2-turn-prev .bd2-paper,.bd2-toast,
  body.studio-refined #sidebar #productionDrawer #insTabs #bd2SceneList .bd2-scene-check.bd2-reviewed>svg{animation:none;}
}

/* ---- Optical centering ----
   Two things pushed text up inside the Breakdown controls:
   1. tableread.css sets `body.production-mode #insights button{line-height:1}` (an ID selector), which beats the
      11px/18px line boxes these controls were designed with. With Windows (Segoe UI) metrics, a line-height of 1
      moves glyphs about 2px off centre.
   2. `--writer-label-offset:-1px` nudges every label up 1px; measured against Segoe UI metrics that leaves 11px text
      in 28px controls about 2px high (more header than footer). Inside the Breakdown workspace the offset is 0. */
body.production-mode #insights :is(.bd2-button,.bd2-item-head,.bd2-category-toggle,.bd2-cast-row,.bd2-suggest-name,.bd2-ready-field .bd2-button){line-height:18px;}
body.bd2-active #iBody,#bd2Toolbar,#bd2Scenes,.bd2-popover,.bd3-popover,.bd2-tag-button{--writer-label-offset:0px;}
body.studio-refined .bd2-suggest-name{align-items:center;}

/* ---- Scene ⇄ All Items ----
   Linked Scenes quote the script line each tag sits on; the open card's Item fold jumps to All Items. */
.bd2-linked-use>summary .bd2-linked-quote{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:1px 0 2px;color:var(--dim);font:400 11px/16px var(--mono);}
.bd2-linked-use>summary .bd2-linked-quote::before,.bd2-linked-use>summary .bd2-linked-quote::after{content:none;}
.bd2-linked-use>summary .bd2-linked-quote mark{padding:0 1px;border-radius:2px;background:color-mix(in srgb,var(--bd2-tone) 38%,transparent);color:var(--text);}
.bd2-item-everywhere{display:flex;justify-content:flex-end;margin:-2px 0 0;}
body.studio-refined .bd2-item-everywhere .bd2-button{height:22px;min-height:22px;padding:0 8px;font-size:11px;}

/* The selected workspace gets a small, vertically centered accent dot.
   Keep the existing label positions and header geometry unchanged. */
body.studio-refined #brand #workspaceDock :is(#writerBtn,#brandHome,#toolsBtn)[aria-pressed=true]::after{
  box-sizing:border-box;left:10px;right:auto;top:50%;bottom:auto;width:4px;height:4px;
  transform:translateY(-50%);border:0;border-radius:50%;background:var(--workspace-tone);box-shadow:none;
}
