/* Director: one centred chat column (about 760 px), a collapsible history drawer on the left, an empty state that is just a greeting, a composer and
   four starter chips. Plans are one compact card in the chat; every dense control sits behind "Details". All rules are scoped under .dx.
   (The older two-pane Director rules in style.css are no longer used by the page; the plan ticket, kit card and chip styles still are.) */
body.dirpage main { padding:0; max-width:none; }
.dx { --dxw:760px; display:grid; grid-template-columns:0 minmax(0, 1fr); height:calc(100vh - 60px); height:calc(100dvh - 60px); position:relative; overflow:hidden; transition:grid-template-columns .22s var(--ease); }
.dx.side-on { grid-template-columns:268px minmax(0, 1fr); }
.dx-side { overflow:hidden; border-right:1px solid var(--line); background:var(--ink-2); display:flex; flex-direction:column; min-width:0; visibility:hidden; }
.dx.side-on .dx-side { visibility:visible; }
.dx-new { margin:14px 12px 8px; height:40px; justify-content:flex-start; gap:8px; border-radius:12px; background:transparent; border:1px solid var(--line-2); color:var(--cream); font-weight:600; white-space:nowrap; }
.dx-new:hover { border-color:var(--brass-line); background:var(--brass-wash); }
.dx-hist { overflow:auto; padding:4px 8px 16px; display:flex; flex-direction:column; gap:2px; min-height:0; width:268px; }
.dx-grp + .dx-grp { margin-top:14px; }
.dx-gh { margin:0; padding:4px 12px; font-family:inherit; font-size:11.5px; font-weight:600; line-height:1.4; letter-spacing:0; color:var(--cream-3); }
.dx-row { position:relative; min-width:0; }
.dx-th { display:flex; flex-direction:column; gap:1px; padding:8px 34px 8px 12px; border-radius:10px; color:var(--cream-2); text-decoration:none !important; font-size:13.5px; min-width:0; }
.dx-th:hover { background:var(--ink-4); color:var(--cream); }
.dx-th.on { background:var(--brass-wash); color:var(--cream); box-shadow:inset 2px 0 0 var(--brass); }
.dx-ren { position:absolute; top:50%; right:4px; transform:translateY(-50%); width:28px; height:28px; min-height:0; padding:0; display:grid; place-items:center; border:0; border-radius:8px; background:transparent; color:var(--cream-3); box-shadow:none; opacity:0; }
.dx-row:hover .dx-ren, .dx-row.on .dx-ren, .dx-ren:focus-visible { opacity:1; }
.dx-ren:hover { color:var(--cream); background:var(--ink-5); }
.dx-row.renaming .dx-th, .dx-row.renaming .dx-ren { display:none; }
input[type=text].dx-rin { display:block; width:100%; height:36px; min-height:0; padding:0 10px; border-radius:10px; font-size:13.5px; }
@media (hover:none) { .dx-ren { opacity:1; } }
.dx-scrim { display:none; }
.dx-main { position:relative; display:flex; flex-direction:column; min-width:0; min-height:0; background:radial-gradient(70% 40% at 50% 0%, rgba(74,21,25,.30), rgba(11,9,9,0) 70%); }
.dx-bar { display:flex; align-items:center; gap:10px; padding:10px 16px; min-height:52px; flex:none; }
.dx-title { font-family:var(--serif); font-size:20px; color:var(--cream-2); max-width:46vw; }
.dx-scroll { flex:1; overflow:auto; min-height:0; padding:8px 16px 24px; scroll-behavior:smooth; }
.dx-col { width:100%; max-width:var(--dxw); margin:0 auto; display:flex; flex-direction:column; gap:18px; }
.dx-foot { flex:none; padding:0 16px 18px; display:flex; flex-direction:column; }
.dx-foot .dx-col { gap:10px; }
/* the empty state: greeting, one large composer, four chips, centred; nothing else */
.dx.is-empty .dx-main { justify-content:center; padding-bottom:6vh; }
.dx.is-empty .dx-bar { position:absolute; top:0; left:0; right:0; }
.dx.is-empty .dx-title, .dx.is-empty #dnew2 { visibility:hidden; }
.dx.is-empty .dx-scroll { flex:none; overflow:visible; padding-bottom:18px; }
.dx.is-empty .dx-foot { padding-bottom:0; }
.dx-hello { align-items:center; text-align:center; }
.dx-hello h1 { font-size:clamp(34px, 5.2vw, 52px); margin:0; }
.dx.is-empty .dx-comp { min-height:128px; border-radius:22px; padding:16px 16px 12px 20px; }
.dx.is-empty .dx-comp textarea { min-height:60px; font-size:16px; }
.dx.is-empty .dx-quick { order:2; justify-content:center; margin-top:6px; }
/* conversation */
.dx-msg { display:flex; gap:12px; min-width:0; }
.dx-msg.me { justify-content:flex-end; }
.dx-msg.me .dx-bub { background:var(--ink-4); border:1px solid var(--line-2); padding:10px 15px; border-radius:18px 18px 4px 18px; max-width:85%; }
.dx-msg.ai .dx-bub { padding:3px 0; }
.dx-bub { font-size:15px; line-height:1.5; color:var(--cream); overflow-wrap:anywhere; }
.dx-bub.warn { color:var(--amber); } .dx-bub.bad { color:var(--bad); }
.dx-av { width:28px; height:28px; border-radius:50%; flex:none; display:grid; place-items:center; font-family:var(--serif); font-style:italic; font-size:16px; color:var(--brass-ink); background:linear-gradient(180deg, #E6C78F, #B8925A); margin-top:1px; }
.dx-body { display:flex; flex-direction:column; gap:10px; min-width:0; flex:1; }
.dx-body .thinking { padding:8px 0; }
/* quick replies under a question, follow-up chips above the composer */
.dx-opts { display:flex; flex-wrap:wrap; gap:8px; }
.dx-opt, .dx-chip { height:auto; min-height:36px; padding:7px 15px; border-radius:999px; border:1px solid var(--line-2); background:rgba(241,232,218,.04); color:var(--cream); font-size:13.5px; font-weight:550; cursor:pointer; display:inline-flex; align-items:center; gap:6px; white-space:normal; text-align:left; line-height:1.3; box-shadow:none; }
.dx-opt:hover, .dx-chip:hover { border-color:var(--brass-line); background:var(--brass-wash); }
.dx-opt small { color:var(--cream-3); font-weight:450; margin-left:2px; }
.dx-opt.alt { color:var(--brass); }
.dx-quick { display:flex; flex-wrap:wrap; gap:8px; order:-1; }
.dx-quick:empty { display:none; }
.dx-chip { font-size:13px; min-height:32px; padding:5px 13px; }
/* the composer */
.dx-comp { border:1px solid var(--line-2); background:var(--ink-3); border-radius:20px; padding:12px 12px 8px 16px; box-shadow:var(--shadow); transition:border-color var(--fast); }
.dx-comp:focus-within { border-color:var(--brass-line); }
.dx-comp textarea { display:block; width:100%; border:0; background:none; padding:2px 0; min-height:26px; max-height:200px; font-size:15px; resize:none; outline:none; box-shadow:none; }
.dx-crow { display:flex; align-items:center; gap:10px; margin-top:6px; min-width:0; }
.dx-det { height:30px; padding:0 11px; border-radius:999px; font-size:12.5px; background:transparent; border:1px solid var(--line-2); color:var(--cream-2); display:inline-flex; gap:6px; align-items:center; box-shadow:none; flex:none; }
.dx-det:hover, .dx-det.on { border-color:var(--brass-line); color:var(--cream); }
.dx-sum { flex:1; min-width:0; }
.dx-crow .send { width:36px; height:36px; padding:0; margin-left:auto; flex:none; border-radius:50%; }
/* Details: scene, series, season, outputs, photo set */
.dx-panel { border:1px solid var(--line-2); background:var(--ink-2); border-radius:16px; padding:6px 16px 12px; max-height:46vh; overflow:auto; }
.dx-prow { display:grid; grid-template-columns:96px minmax(0, 1fr); gap:10px; align-items:center; padding:9px 0; border-bottom:1px solid var(--line); }
.dx-prow:last-child { border-bottom:0; }
.dx-prow > label { margin:0; font-size:12.5px; color:var(--cream-2); }
.dx-prow.col { display:block; } .dx-prow.col > label { display:block; margin-bottom:8px; }
.dx-pv { display:flex; align-items:center; gap:10px; justify-content:space-between; min-width:0; flex-wrap:wrap; }
.dx-pv select { max-width:100%; }
.dx-note { display:flex; gap:12px; align-items:flex-start; border:1px solid rgba(231,166,90,.3); border-radius:14px; padding:12px 14px; font-size:13.5px; background:var(--ink-2); }
.dx-note .ic { color:var(--amber); flex:none; }
.dx-vids { max-height:52vh; }
.dx-pick { max-width:640px; }
/* the plan card */
.dx-plan { border:1px solid var(--line-2); background:var(--ink-3); border-radius:18px; padding:16px 18px 14px; display:flex; flex-direction:column; gap:10px; box-shadow:var(--shadow); }
.dx-plan.st-proposed { border-color:var(--brass-line); }
.dx-plan-h { display:flex; align-items:center; gap:10px; justify-content:space-between; }
.dx-plan-t { font-family:var(--serif); font-weight:400; font-size:25px; line-height:1.1; }
.dx-plan-what { display:flex; flex-wrap:wrap; gap:6px; }
.dx-plan-meta { display:flex; align-items:center; gap:8px; min-width:0; }
.dx-pth { width:42px; height:24px; object-fit:cover; border-radius:5px; flex:none; background:var(--ink-4); }
.dx-plan-f { display:flex; align-items:center; gap:10px; padding-top:10px; border-top:1px dashed var(--line-2); flex-wrap:wrap; }
.dx-cr { font-family:var(--serif); font-size:32px; line-height:1; white-space:nowrap; }
.dx-cr small { font-family:var(--sans); font-size:12px; color:var(--cream-3); margin-left:7px; }
.dx-plan-note { margin:-2px 0 0; }
.dx-plan.is-stale { border-color:var(--line-2); opacity:.72; }
.dx-plan.dx-hl { animation:dxhl 2.4s ease-out; }
@keyframes dxhl { 0%, 35% { box-shadow:0 0 0 3px var(--brass-line), var(--shadow); } 100% { box-shadow:var(--shadow); } }
.lib-onb { margin:14px 0 0; align-items:center; }
.lib-onb a { white-space:nowrap; }
@media (max-width:400px) { .tabbar a { min-width:0; flex:1 1 0; min-height:50px; padding:0 2px; } }
.dx-wallet { color:var(--brass); text-decoration:underline; white-space:nowrap; }
@media (prefers-reduced-motion: reduce) { .dx-plan.dx-hl { animation:none; box-shadow:0 0 0 3px var(--brass-line), var(--shadow); } }
.dx-full { margin-top:4px; }
.dx-full .pcard { margin:0; }
.dx-stub { display:flex; align-items:center; gap:8px; padding:8px 12px; border:1px dashed var(--line-2); border-radius:12px; font-size:13px; color:var(--cream-3); }
.dx-kits { margin-top:2px; }
/* phone: the drawer slides over the page, hidden by default; chips and card stack */
@media (max-width:899px) {
  .dx, .dx.side-on { grid-template-columns:minmax(0, 1fr); }
  .dx-side { position:fixed; top:60px; bottom:0; left:0; width:min(300px, 84vw); z-index:70; transform:translateX(-102%); transition:transform .22s var(--ease); box-shadow:var(--shadow-l); visibility:visible; }
  .dx.side-on .dx-side { transform:none; }
  .dx.side-on .dx-scrim { display:block; position:fixed; inset:60px 0 0 0; background:rgba(0,0,0,.55); z-index:65; }
  .dx-hist { width:auto; }
  .dx-th { padding:11px 44px 11px 12px; }
  .dx-ren { width:38px; height:38px; right:2px; opacity:1; }
  input[type=text].dx-rin { height:42px; font-size:16px; }   /* 16 px: a phone does not zoom the page into the box */
  .dx-foot { padding-bottom:86px; }
  .dx.is-empty .dx-main { justify-content:center; padding-bottom:70px; }
  .dx-scroll { padding:6px 14px 18px; }
  .dx-title { max-width:50vw; }
  .dx-plan { padding:14px 14px 12px; }
  .dx-plan-f .primary { flex:1; }
  .dx-prow { grid-template-columns:1fr; gap:6px; }
  .dx-cr { font-size:28px; }
}
.dx-kits .kit { overflow:hidden; max-width:100%; }
.dx-body, .dx-kits { max-width:100%; }

/* edit by chat */
.dx-edit { padding: 12px 14px; }
.dx-elines { margin: 8px 0; padding-left: 18px; font-size: 14px; }
.dx-eact { gap: 10px; align-items: center; margin-top: 8px; }
.dx-ba { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 8px; }
.dx-ba figure { margin: 0; }
.dx-ba figcaption { font-size: 12px; opacity: .7; margin-bottom: 4px; }
.dx-bamedia { width: 100%; max-height: 320px; object-fit: contain; border-radius: 8px; background: #000; }

/* ui5 phone: the composer is pinned to the bottom; while typing the tab bar steps aside; 16 px text so iOS does not zoom */
@media (max-width:860px) {
  .dx { height:calc(100vh - 60px); height:calc(100dvh - 60px); }
  .dx-side { top:60px; } .dx.side-on .dx-scrim { inset:60px 0 0 0; }
  .dx-comp textarea { font-size:16px; }
  .dx-comp .send { width:44px; height:44px; }
  .dx-crow .dx-det { min-height:40px; }
  .dx-opt { min-height:44px; }
  body.dirpage.typing .tabbar { display:none; }
  body.dirpage.typing .dx-foot { padding-bottom:10px; }
}
/* frame browser ("show me the frames so I pick one"): a tappable grid of the scene's frames in the chat; the picked frame rides on the next message */
.dx-frames { margin-top:8px; width:100%; }
.dx-fgrid { display:grid; grid-template-columns:repeat(auto-fill, minmax(112px, 1fr)); gap:8px; max-height:min(62vh, 560px); overflow-y:auto; overscroll-behavior:contain; padding:2px; -webkit-overflow-scrolling:touch; }
.dx-fr { position:relative; display:block; width:100%; height:auto; min-height:0; padding:0; border:1px solid var(--line-2); border-radius:10px; overflow:hidden; background:var(--ink-2); cursor:pointer; box-shadow:none; aspect-ratio:16/9; touch-action:manipulation; }
.dx-fr img { width:100%; height:100%; object-fit:cover; display:block; }
.dx-fr .dx-ft { position:absolute; left:5px; bottom:5px; font-size:11px; line-height:1; padding:3px 5px; border-radius:6px; background:rgba(0,0,0,.62); color:#fff; }
.dx-fr .dx-fu { position:absolute; right:5px; top:5px; display:grid; place-items:center; width:20px; height:20px; border-radius:6px; background:rgba(0,0,0,.55); color:var(--brass); }
.dx-fr small { position:absolute; left:0; right:0; top:0; padding:4px 28px 10px 6px; font-size:10.5px; color:#fff; text-align:left; background:linear-gradient(rgba(0,0,0,.55), transparent); opacity:0; transition:opacity var(--fast); }
.dx-fr:hover small, .dx-fr:focus-visible small { opacity:1; }
.dx-fr:hover, .dx-fr:focus-visible { border-color:var(--brass-line); }
.dx-fr.on { border-color:var(--brass); box-shadow:0 0 0 2px var(--brass); }
.dx-fr.on::after { content:'\2713'; position:absolute; right:6px; bottom:5px; width:20px; height:20px; border-radius:50%; display:grid; place-items:center; font-size:12px; font-weight:700; background:var(--brass); color:var(--brass-ink); }
.dx-fr.nofr { background:repeating-linear-gradient(135deg, var(--ink-2) 0 8px, var(--ink-3) 8px 16px); }
.dx-ref { display:flex; align-items:center; gap:8px; margin:0 0 8px; padding:5px 6px 5px 5px; border:1px solid var(--brass-line); background:var(--brass-wash); border-radius:12px; font-size:13px; }
.dx-ref img { width:56px; height:32px; object-fit:cover; border-radius:6px; flex:none; background:var(--ink-2); }
.dx-ref span { flex:1; min-width:0; }
.dx-bref { display:flex; align-items:center; gap:6px; margin:0 0 6px; }
.dx-bref img { width:72px; height:40px; object-fit:cover; border-radius:6px; background:var(--ink-2); }
@media (max-width:560px) {
  .dx-fgrid { grid-template-columns:repeat(3, minmax(0, 1fr)); gap:6px; max-height:56vh; }
  .dx-fr small { display:none; }
  .dx-fr .dx-ft { font-size:10px; }
}
@media (max-width:360px) { .dx-fgrid { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
/* e2e-fix1: Confirm shows "Starting…" the moment it is tapped */
.dx-plan [data-dok].starting { opacity:1; display:inline-flex; align-items:center; gap:8px; cursor:progress; }
/* the editing pill sits inside the composer, above the text */
.dx-comp .dx-focus.in { border:0; background:none; padding:0 0 6px; margin:0 0 4px; border-bottom:1px solid var(--line-2); border-radius:0; font-size:12.5px; min-height:0; }
.dx-comp .dx-focus.in .icon-btn { width:28px; height:28px; min-height:28px; }
/* phone: the quick chips are one horizontally scrolling row, and they fold away while the keyboard is open */
@media (max-width:860px) {
  .dx-quick, .dx.is-empty .dx-quick { flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; justify-content:flex-start; scrollbar-width:none; -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain;
    margin:0 -16px; padding:0 16px; scroll-padding:0 16px; }
  .dx-quick::-webkit-scrollbar { display:none; }
  .dx-quick .dx-chip { flex:none; white-space:nowrap; }
  body.dirpage.typing .dx-quick { display:none; }
  .dx-foot .dx-col { gap:8px; }
}
.dx-md h4.dx-h { font-size:13.5px; font-weight:650; margin:14px 0 4px; letter-spacing:.01em; }
.dx-md h4.dx-h:first-child { margin-top:2px; }
/* action / asset / delivery cards in an answer, and the Ads pre-roll proposal (api/director_features.py) */
.dx-card { border:1px solid var(--line-2); background:var(--ink-3); border-radius:14px; padding:12px 14px; margin-top:8px; display:flex; flex-direction:column; gap:6px; min-width:0; }
.dx-card .row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.dx-ads .dx-ar { display:grid; grid-template-columns:84px minmax(0, 1fr); gap:10px; align-items:baseline; }
.dx-ads .dx-ar .ov { min-width:0; overflow-wrap:anywhere; }
.dx-ads .dx-an { margin:0; color:var(--brass); }
/* a chip that names sizes (Creative banners x 6 · Leaderboard 728x90, ...) wraps instead of running off the card */
.dx-plan-what .chip[title] { height:auto; min-height:24px; padding:4px 10px; white-space:normal; line-height:1.3; text-align:left; }
@media (max-width:520px) { .dx-ads .dx-ar { grid-template-columns:1fr; gap:0; } }
