body.cbs-phase60 #modal-root{position:fixed;inset:0;z-index:2000;pointer-events:none}
body.cbs-phase60 #modal-root:not(.hidden){pointer-events:auto}
body.cbs-phase60 #modal-root.hidden:has(.modal-backdrop),
body.cbs-phase60 #modal-root.hidden:has(.modal),
body.cbs-phase60 #modal-root.hidden:has(#beat-editor-modal){
  display:block !important;
  pointer-events:auto !important;
}
.phase60-modal-backdrop{position:fixed;inset:0;background:rgba(10,12,18,.58);display:flex;align-items:center;justify-content:center;padding:24px}
.phase60-guard-modal{max-width:560px;width:min(92vw,560px);border-radius:20px;overflow:hidden}
.phase60-copy{color:#4f3b2a;line-height:1.55;margin:0 0 14px}
.phase60-guard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:8px}
.phase60-guard-grid>div{background:#fff9f0;border:1px solid #ecd9ba;border-radius:14px;padding:12px;display:grid;gap:4px}
.phase60-guard-grid small{color:#6d5844;line-height:1.45}

/* Home hub CTA under the brand */
body.cbs-phase60 #phase60-home-hero{
  display:grid;
  grid-template-columns:minmax(0,1.5fr) minmax(260px,.9fr);
  gap:22px;
  align-items:stretch;
  margin:18px 0 20px;
  padding:20px 22px;
  border-radius:24px;
  border:1px solid rgba(164,118,56,.20);
  background:
    radial-gradient(circle at top right, rgba(255,232,186,.72), transparent 34%),
    linear-gradient(135deg, rgba(255,250,239,.98), rgba(245,229,199,.95));
  box-shadow:0 18px 36px rgba(70,43,15,.10);
  overflow:hidden;
}
body.cbs-phase60 .phase60-home-hero-copy{display:grid;gap:10px;align-content:center}
body.cbs-phase60 .phase60-home-kicker{
  font-size:.7rem;
  font-weight:900;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:#9b6a31;
}
body.cbs-phase60 .phase60-home-hero h2{margin:0;font-size:1.55rem;line-height:1.08;color:#392212}
body.cbs-phase60 .phase60-home-hero p{margin:0;max-width:58ch;line-height:1.58;color:#6e5640}
body.cbs-phase60 .phase60-home-cta{
  position:relative;
  display:inline-grid;
  justify-items:start;
  gap:3px;
  margin-top:6px;
  padding:14px 18px;
  min-width:260px;
  border:none;
  border-radius:18px;
  background:linear-gradient(135deg,#ff9c4a,#ec6b2d 60%,#b84f20);
  color:#fff8f0;
  box-shadow:0 14px 28px rgba(184,79,32,.28);
  cursor:pointer;
  overflow:hidden;
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
body.cbs-phase60 .phase60-home-cta:hover{transform:translateY(-2px);box-shadow:0 18px 32px rgba(184,79,32,.34);filter:saturate(1.04)}
body.cbs-phase60 .phase60-home-cta-label{position:relative;z-index:1;font-weight:900;font-size:1rem}
body.cbs-phase60 .phase60-home-cta-sub{position:relative;z-index:1;font-size:.76rem;opacity:.92}
body.cbs-phase60 .phase60-home-cta-glow{
  position:absolute;
  inset:-40% auto auto -10%;
  width:56%;
  height:180%;
  background:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.28),rgba(255,255,255,0));
  transform:rotate(18deg);
  animation:phase60HubSweep 3.8s linear infinite;
}
body.cbs-phase60 .phase60-home-hero-visual{display:grid;align-items:center}
body.cbs-phase60 .phase60-home-arc-card{
  height:100%;
  min-height:160px;
  padding:18px 18px 14px;
  border-radius:22px;
  background:linear-gradient(180deg,rgba(76,51,28,.94),rgba(46,28,14,.98));
  color:#ffd8a8;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05), 0 16px 28px rgba(45,25,7,.28);
}
body.cbs-phase60 .phase60-home-arc-head{
  font-size:.7rem;
  font-weight:900;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:#f0bd7b;
  margin-bottom:10px;
}
body.cbs-phase60 .phase60-home-arc-svg{width:100%;height:112px;color:#ffb25b}
body.cbs-phase60 .phase60-home-arc-svg circle{fill:#ffe3b0}
body.cbs-phase60 .phase60-home-arc-meta{display:flex;justify-content:space-between;font-size:.78rem;color:#f4d5aa}

@keyframes phase60HubSweep{
  0%{transform:translateX(-40%) rotate(18deg)}
  100%{transform:translateX(260%) rotate(18deg)}
}

/* Retire the legacy floating New button so it cannot overlap the brand/logo */
body.cbs-phase60 #new-btn{
  display:none !important;
  visibility:hidden !important;
  opacity:0 !important;
  pointer-events:none !important;
  width:0 !important;
  min-width:0 !important;
  max-width:0 !important;
  height:0 !important;
  min-height:0 !important;
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
  box-shadow:none !important;
  overflow:hidden !important;
}

body.cbs-phase60.phase60-no-project .nav-tabs .tab,
body.cbs-phase60.phase60-no-project #project-nav .tab{
  opacity:.48 !important;
  filter:saturate(.65) grayscale(.12);
  cursor:not-allowed !important;
  pointer-events:none !important;
  transform:none !important;
}
body.cbs-phase60.phase60-no-project .nav-tabs .tab.active,
body.cbs-phase60.phase60-no-project #project-nav .tab.active{
  opacity:.55 !important;
}

/* Call sheet organization */
#callsheet-app{background:linear-gradient(180deg,#f4ecdd,#efe3cf) !important}
#callsheet-app > div:first-child{background:transparent !important;border:none !important;box-shadow:none !important;padding:18px 18px 0 !important}
#callsheet-app .card{background:linear-gradient(180deg,rgba(255,249,240,.98),rgba(255,252,246,.95));}
#callsheet-app .cs-action-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#callsheet-sheet{
  margin-top:14px !important;
  border:none !important;
  border-radius:24px !important;
  padding:0 !important;
  overflow:hidden;
  box-shadow:0 22px 44px rgba(69,42,16,.12), inset 0 1px 0 rgba(255,255,255,.64);
}
#callsheet-sheet .callsheet-production-header{border-radius:18px 18px 0 0!important}
#callsheet-sheet .cs60-body{display:grid;gap:16px;background:#fffdf8}
#callsheet-sheet .cs60-section{background:#fffaf1;border:1px solid #eadcc4;border-radius:16px;padding:14px 16px;box-shadow:0 6px 18px rgba(67,40,16,.05)}
#callsheet-sheet .cs60-essentials{background:linear-gradient(180deg,#fff7ea,#fffaf3)}
#callsheet-sheet .cs60-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
#callsheet-sheet .cs60-kicker{font-size:.72rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:#9a6d37}
#callsheet-sheet .cs60-section h3{margin:0;color:#352113}
#callsheet-sheet .grid-3,#callsheet-sheet .grid-2{gap:12px}
#callsheet-sheet .field{background:#fff;border:1px solid #eadcc4;border-radius:14px;padding:10px 12px}
#callsheet-sheet .field label{display:flex;justify-content:space-between;align-items:center;gap:8px;font-weight:800;color:#53361f;margin-bottom:6px}
#callsheet-sheet .field input,#callsheet-sheet .field textarea,#callsheet-sheet .field select{background:#fffdf8;border:1px solid #d9c6a6;border-radius:10px;color:#2d1d12}
#callsheet-sheet .field input:focus,#callsheet-sheet .field textarea:focus,#callsheet-sheet .field select:focus{
  outline:none;
  border-color:#cc8a3d;
  box-shadow:0 0 0 3px rgba(204,138,61,.12);
}
#callsheet-sheet .table-scroll{background:#fff;border-radius:14px}
#callsheet-sheet .cs-dept-header{background:#f7ead2!important;color:#6a4217!important;font-weight:900}
body.cbs-phase60 .phase60-send-review{max-width:720px !important;width:min(94vw,720px) !important}
body.cbs-phase60 .phase60-send-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin:14px 0 16px;
}
body.cbs-phase60 .phase60-send-grid > div{
  display:grid;
  gap:4px;
  padding:12px 14px;
  border:1px solid #ead7bb;
  border-radius:14px;
  background:linear-gradient(180deg,#fffaf0,#fff6e8);
}
body.cbs-phase60 .phase60-send-grid span{
  font-size:.7rem;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:#9d6b37;
}
body.cbs-phase60 .phase60-send-grid strong{color:#352113}
body.cbs-phase60 .phase60-send-list{
  display:grid;
  gap:8px;
  max-height:280px;
  overflow:auto;
  padding-right:4px;
}
body.cbs-phase60 .phase60-send-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #ecdcc0;
  background:#fffdf9;
}
body.cbs-phase60 .phase60-send-row span{color:#7b6247;font-size:.82rem}

/* Project/corkboard readability */
body.cbs-phase60 [data-active-view="stripboard-app"] .pill,
body.cbs-phase60 #stripboard-app .strip-status,
body.cbs-phase60 #stripboard-app .strip-note-preview,
body.cbs-phase60 #stripboard-app .strip-sub,
body.cbs-phase60 #stripboard-app .sb-banner,
body.cbs-phase60 #stripboard-app .sb-banner-label,
body.cbs-phase60 #stripboard-app .sb-banner-time{
  color:#24150b !important;
}
body.cbs-phase60 #stripboard-app .strip-note-preview,
body.cbs-phase60 #stripboard-app .strip-sub{
  background:linear-gradient(180deg,#fff9e8,#fff6dd) !important;
  border:1px solid rgba(157,118,63,.28)!important;
  border-radius:12px!important;
  padding:8px 10px!important;
  box-shadow:0 6px 12px rgba(52,31,12,.08)!important;
  font-style:normal!important;
}
body.cbs-phase60 #stripboard-app .strip-note-preview{position:relative;overflow:hidden}
body.cbs-phase60 #stripboard-app .strip-note-preview::before{
  content:"";position:absolute;inset:0;background:linear-gradient(transparent 0 22px, rgba(157,118,63,.08) 22px 23px);pointer-events:none;opacity:.25
}
body.cbs-phase60 .sticky-note,
body.cbs-phase60 .tl-card,
body.cbs-phase60 .note,
body.cbs-phase60 .series-beat-chip,
body.cbs-phase60 .modal,
body.cbs-phase60 .modal-body{color:#2b1a10}

body.cbs-phase60 #beat-editor-modal{
  width:min(700px,94vw) !important;
  margin:0 auto !important;
  border:1px solid rgba(174,122,57,.18);
  border-radius:20px !important;
  box-shadow:0 28px 60px rgba(32,22,14,.28) !important;
}
body.cbs-phase60 #beat-editor-modal .modal-body{
  background:linear-gradient(180deg,rgba(255,251,244,.98),rgba(247,237,221,.98)) !important;
}
body.cbs-phase60 #corkboard-app .sticky-note[data-beat-id],
body.cbs-phase60 #corkboard-app .tl-card[data-beat-id]{
  cursor:pointer;
}

/* Wardrobe tuning */
body.cbs-phase60 #wardrobe-app .wde-scene-row{grid-template-columns:18px minmax(0,1fr) auto !important;align-items:center;gap:8px;padding:8px 10px}
body.cbs-phase60 #wardrobe-app .wde-scene-cb{width:18px!important;height:18px!important;accent-color:#c77d1c}
body.cbs-phase60 #wardrobe-app .wde-scene-cond{min-height:34px!important;padding:4px 10px!important;font-size:.82rem!important}
body.cbs-phase60 #wardrobe-app .wde-scene-row .switch,
body.cbs-phase60 #wardrobe-app .wde-scene-row label.switch,
body.cbs-phase60 #wardrobe-app .wde-scene-row .toggle{transform:scale(.92);transform-origin:left center}

/* Locations: pastel card accents with editable swatches */
body.cbs-phase60 #locations-app .loc-card{
  position:relative;
  border-color:var(--loc-accent-soft, #e5e7eb) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.96)),
    linear-gradient(135deg, var(--loc-accent-tint, #f8efe9), #fffdf9 56%) !important;
  box-shadow:0 14px 26px rgba(65, 41, 12, .07) !important;
}
body.cbs-phase60 #locations-app .loc-card::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:8px;
  border-radius:14px 0 0 14px;
  background:linear-gradient(180deg, var(--loc-accent, #d8c7b1), var(--loc-accent-soft, #efe4d9));
}
body.cbs-phase60 #locations-app .loc-color-bar{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 7px;
  border:1px solid rgba(155,116,62,.16);
  border-radius:999px;
  background:rgba(255,251,244,.9);
}
body.cbs-phase60 #locations-app .loc-color-bar-label{
  font-size:.68rem;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#92663a;
}
body.cbs-phase60 #locations-app .loc-color-swatch{
  width:18px;
  height:18px;
  border-radius:999px;
  border:1px solid rgba(87,58,25,.14);
  background:var(--sw);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.45);
  cursor:pointer;
  padding:0;
}
body.cbs-phase60 #locations-app .loc-color-swatch.active{
  transform:scale(1.08);
  outline:2px solid rgba(146,102,58,.22);
  outline-offset:2px;
}
body.cbs-phase60 #locations-app .loc-color-custom{
  position:relative;
  display:inline-grid;
  place-items:center;
  width:26px;
  height:26px;
  border-radius:999px;
  background:#fff6e9;
  border:1px solid rgba(155,116,62,.16);
  overflow:hidden;
  cursor:pointer;
}
body.cbs-phase60 #locations-app .loc-color-custom input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}

/* Shot list: give the planner more breathing room so controls fit cleanly */
body.cbs-phase60 #shotlist-app .card{
  background:linear-gradient(180deg, rgba(255,250,243,.98), rgba(243,233,214,.96));
  border:1px solid rgba(171,127,69,.16);
  border-radius:24px;
  padding:20px;
  box-shadow:0 20px 38px rgba(63,38,14,.10);
}
body.cbs-phase60 #shotlist-app .shot-table-wrap{
  border:2px solid rgba(171,127,69,.28) !important;
  border-radius:18px !important;
  background:#fffdf9;
  padding:4px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.82);
}
body.cbs-phase60 #shotlist-app table{
  min-width:980px !important;
}
body.cbs-phase60 #shotlist-app th,
body.cbs-phase60 #shotlist-app td{
  white-space:nowrap;
}
body.cbs-phase60 #shotlist-app td:nth-child(5){
  min-width:220px;
  white-space:normal;
}

/* Keep script notes strictly writer-only so specialty shells never get a stray floating control */
body.cbs-phase60:not(.phase60-writer-active) #sn-panel,
body.cbs-phase60:not(.phase60-writer-active) #sn-toolbar-btn,
body.cbs-phase60:not(.phase60-writer-active) #sn-popover{
  display:none !important;
  visibility:hidden !important;
  opacity:0 !important;
  pointer-events:none !important;
}

/* Hub folders: richer corkboard-themed cards */
body.cbs-phase60 .folder{
  position:relative;
  isolation:isolate;
  transition:transform .18s ease, filter .18s ease;
  padding-top:22px;
}
body.cbs-phase60 #hub-folder-grid{
  grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)) !important;
}
body.cbs-phase60 .folder:hover,
body.cbs-phase60 .folder:focus-within{
  transform:translateY(-4px);
  filter:drop-shadow(0 8px 16px rgba(0,0,0,.16));
}
body.cbs-phase60 .folder-tab{
  width:92px;
  height:22px;
  background:#f5d0a9;
  border-radius:10px 10px 0 0;
  border:1px solid #cbb08a;
  border-bottom:none;
  position:absolute;
  top:0;
  left:0;
  z-index:2;
}
body.cbs-phase60 .folder-body{
  position:relative;
  overflow:hidden;
  margin-top:0;
  border:1px solid #cbb08a !important;
  border-radius:0 10px 10px 10px !important;
  background:linear-gradient(180deg, #fdf0cf, #f8e4bc) !important;
  box-shadow:3px 5px 14px rgba(0,0,0,.13), 0 1px 0 rgba(255,255,255,.65) inset !important;
  padding:12px 12px 12px;
  display:flex;
  flex-direction:column;
  gap:6px;
  min-height:154px;
}
body.cbs-phase60 .folder-body::before{
  display:none;
}
body.cbs-phase60 .folder-label{
  position:relative;
  z-index:3;
  margin:4px 34px 2px 0 !important;
  display:block;
  align-self:flex-start;
  max-width:calc(100% - 20px);
  white-space:normal;
  line-height:1.24;
  max-height:none !important;
  overflow:visible;
  padding:8px 10px;
  transform:rotate(-.7deg);
  border-radius:10px !important;
  background:#fffdf9 !important;
  box-shadow:1px 2px 6px rgba(0,0,0,.10) !important;
  border:1px solid rgba(122,79,28,.16) !important;
}
body.cbs-phase60 .folder-label::after{
  display:none;
}
body.cbs-phase60 .folder-meta{
  margin-top:2px;
  font-size:.75rem;
  color:#886a4a;
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-weight:800;
}
body.cbs-phase60 .folder-type-badge{
  align-self:flex-start;
  margin-top:0;
}
body.cbs-phase60 .folder-type-badge{
  background:linear-gradient(135deg, rgba(118,73,21,.92), rgba(176,111,40,.90)) !important;
  color:#fff4df !important;
  border-radius:999px !important;
  padding:4px 9px !important;
  box-shadow:0 8px 14px rgba(87,51,17,.16);
}
body.cbs-phase60 .folder-actions{
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:auto;
  padding-top:4px;
  flex-wrap:nowrap;
  overflow:hidden;
}
body.cbs-phase60 .folder-actions .btn.mini{
  inline-size:32px;
  block-size:32px;
  min-inline-size:32px;
  min-block-size:32px;
  padding:0 !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1.1 !important;
  font-size:.92rem;
  overflow:visible;
  flex:0 0 32px;
}
body.cbs-phase60 .folder-actions .btn.mini > span,
body.cbs-phase60 .folder-actions .btn.mini{
  text-rendering:optimizeLegibility;
}
body.cbs-phase60 .folder-hover-delete{
  position:absolute;
  top:8px;
  right:8px;
  z-index:5;
  inline-size:28px;
  block-size:28px;
  min-inline-size:28px;
  min-block-size:28px;
  border-radius:999px !important;
  padding:0 !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  transform:translateY(-2px) scale(.92);
  transition:opacity .16s ease, transform .16s ease, background .16s ease, color .16s ease;
  background:rgba(255,255,255,.92) !important;
  border:1px solid rgba(185,28,28,.18) !important;
  color:#b91c1c !important;
  box-shadow:0 4px 10px rgba(0,0,0,.10);
}
body.cbs-phase60 .folder:hover .folder-hover-delete,
body.cbs-phase60 .folder:focus-within .folder-hover-delete{
  opacity:1;
  transform:translateY(0) scale(1);
}
body.cbs-phase60 .folder-hover-delete:hover{
  background:#fff1f2 !important;
  border-color:rgba(185,28,28,.28) !important;
  color:#991b1b !important;
}
body.cbs-phase60 .folder-actions .folder-more-btn{
  font-size:1.05rem;
  font-weight:900;
  letter-spacing:0;
}

/* Normalize app toggles */
body.cbs-phase60 input[type="checkbox"],
body.cbs-phase60 input[type="radio"]{accent-color:#b56c13}
body.cbs-phase60 input[type="checkbox"]{
  appearance:none;
  -webkit-appearance:none;
  inline-size:18px;
  block-size:18px;
  min-inline-size:18px;
  min-block-size:18px;
  flex:0 0 18px;
  display:inline-grid;
  place-content:center;
  margin:0;
  vertical-align:middle;
  border-radius:6px;
  border:1.5px solid rgba(58,38,18,.26);
  background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(245,236,221,.94));
  cursor:pointer;
  box-shadow:0 1px 3px rgba(27,31,35,.12);
  transition:background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .12s ease;
}
body.cbs-phase60 input[type="checkbox"]::before{
  content:"";
  inline-size:10px;
  block-size:10px;
  transform:scale(0);
  transform-origin:center;
  transition:transform .14s ease;
  clip-path:polygon(14% 52%, 0 66%, 38% 100%, 100% 18%, 84% 4%, 36% 62%);
  background:#fff;
}
body.cbs-phase60 input[type="checkbox"]:hover{
  box-shadow:0 6px 16px rgba(35,25,16,.16);
}
body.cbs-phase60 input[type="checkbox"]:checked{
  background:linear-gradient(180deg, #4f8cff, #245fe8);
  border-color:#245fe8;
}
body.cbs-phase60 input[type="checkbox"]:checked::before{
  transform:scale(1);
}
body.cbs-phase60 input[type="checkbox"]:focus-visible{
  outline:2px solid rgba(66,133,244,.28);
  outline-offset:2px;
}
body.cbs-phase60 .collab-toggle,.cbs-phase60 .mvx-toggle{min-height:auto}

/* Project gate + tag editor modal polish */
body.cbs-phase60 .phase60-modal-backdrop{
  background:radial-gradient(circle at top, rgba(255,236,200,.16), transparent 28%), rgba(10,12,18,.62);
  backdrop-filter:blur(10px);
}
body.cbs-phase60 .phase60-guard-modal,
body.cbs-phase60 #modal-root .modal{
  border:1px solid rgba(175,122,57,.22);
  background:linear-gradient(180deg, rgba(255,251,244,.98), rgba(248,237,218,.98));
  box-shadow:0 26px 60px rgba(47,28,12,.24), inset 0 1px 0 rgba(255,255,255,.72);
}
body.cbs-phase60 .phase60-guard-modal .modal-header,
body.cbs-phase60 #modal-root .modal .modal-header{
  background:linear-gradient(180deg, rgba(255,247,232,.96), rgba(248,234,207,.92));
  border-bottom:1px solid rgba(175,122,57,.16);
}
body.cbs-phase60 .phase60-guard-modal .modal-footer,
body.cbs-phase60 #modal-root .modal .modal-footer{
  background:rgba(255,249,239,.78);
  border-top:1px solid rgba(175,122,57,.12);
}

/* Beat template modal cleanup */
body.cbs-phase60 #beat-template-modal{
  padding:24px !important;
  backdrop-filter:blur(8px);
  background:rgba(8,10,15,.64) !important;
}
body.cbs-phase60 #beat-template-modal > div{
  width:min(620px, 94vw) !important;
  margin:auto !important;
  border:1px solid rgba(175,122,57,.18);
  background:linear-gradient(180deg, rgba(255,251,244,.98), rgba(247,237,221,.98)) !important;
  box-shadow:0 28px 60px rgba(26,18,12,.30) !important;
}

/* Storyboard panels */
body.cbs-phase60 #storyboard-app .sb-canvas-wrap{
  aspect-ratio:16/10 !important;
  min-height:260px;
}

/* Writer tags should feel clickable and always open the editor cleanly */
body.cbs-phase60 #pages-container .tag{
  cursor:pointer;
}
body.cbs-phase60 .script-page-sheet:focus-within{
  box-shadow:0 1px 3px rgba(0,0,0,.1), 0 8px 24px rgba(0,0,0,.14) !important;
}
body.cbs-phase60 #writer-app .page-content:focus,
body.cbs-phase60 #writer-app .page-content:focus-visible,
body.cbs-phase60 #writer-app .line:focus,
body.cbs-phase60 #writer-app .line:focus-visible,
body.cbs-phase60 #writer-app [contenteditable="true"]:focus,
body.cbs-phase60 #writer-app [contenteditable="true"]:focus-visible{
  outline:none !important;
  box-shadow:none !important;
}

/* Wardrobe usability polish */
body.cbs-phase60 #wardrobe-app .wdp2-char-header{
  align-items:flex-start;
  row-gap:8px;
}
body.cbs-phase60 #wardrobe-app .wdp2-char-header > span{
  flex:1 1 180px;
  min-width:0;
}
body.cbs-phase60 #wardrobe-app .wdp2-char-header select{
  min-height:40px;
}
body.cbs-phase60 #wardrobe-app .wdp2-char-header .wdp2-btn{
  min-height:40px;
  white-space:nowrap;
}
body.cbs-phase60 #wardrobe-app .wdp2-scenes-grid{
  grid-template-columns:repeat(auto-fill, minmax(250px, 1fr));
}
body.cbs-phase60 #wardrobe-app .wdp2-scene-actions{
  gap:10px;
  flex-wrap:wrap;
}
body.cbs-phase60 #wardrobe-app .wdp2-scene-actions .wdp2-btn{
  min-height:40px;
  font-weight:800;
}
body.cbs-phase60 #wardrobe-app .wdp2-scene-cost{
  margin-left:auto;
}
body.cbs-phase60 #wardrobe-app .wdp2-topbar-pills,
body.cbs-phase60 #wardrobe-app .wdp2-action-group{
  flex:1 1 260px;
}
body.cbs-phase60 #wardrobe-app .wdp2-field-pill{
  min-width:150px;
}
body.cbs-phase60 #wardrobe-app .wdp2-topbar{
  align-items:flex-end;
}
body.cbs-phase60 #wardrobe-app .wdp2-topbar-pills{
  justify-content:flex-start;
}
body.cbs-phase60 #wardrobe-app .wdp2-action-group{
  justify-content:flex-end;
}

/* Series room scroll + buttons */
#seriesroom-app,#seriesroom-root{overflow:auto!important;-webkit-overflow-scrolling:touch}
#seriesroom-root [data-sr56-action]{scroll-margin-top:90px}

/* Make hidden panes truly inert and prevent half-width shell splits */
body.cbs-phase60 .view-container > [id$="-app"].hidden,
body.cbs-phase60 .view-container > #project-hub.hidden{
  display:none !important;
  visibility:hidden !important;
  opacity:0 !important;
  pointer-events:none !important;
  flex:0 0 auto !important;
  min-width:0 !important;
  max-width:0 !important;
  width:0 !important;
  overflow:hidden !important;
}

/* Desktop shell normalization:
   older hotfix layers force 100dvh min-heights on shared containers/apps,
   which can push specialty studios a full viewport below the visible shell. */
@media (min-width: 761px){
  html body.cbs-phase60{
    min-height:100vh !important;
    height:100vh !important;
  }

  body.cbs-phase60 #app,
  body.cbs-phase60 .view-container{
    min-height:0 !important;
  }

  body.cbs-phase60 .view-container{
    height:calc(100vh - var(--phase60-shell-offset, 68px)) !important;
    max-height:calc(100vh - var(--phase60-shell-offset, 68px)) !important;
    align-items:stretch !important;
    overflow:hidden !important;
  }

  body.cbs-phase60 :where(
    #project-hub,
    #writer-app,
    #corkboard-app,
    #seriesroom-app,
    #documentary-app,
    #adtreatment-app,
    #festival-app,
    #musicvideo-app,
    #podcast-app,
    #pcc-app,
    #spatial-app,
    #stripboard-app,
    #callsheet-app,
    #shotlist-app,
    #locations-app,
    #contacts-app,
    #auditions-app,
    #schedule-app,
    #dood-app,
    #storyboard-app,
    #budget-app,
    #cine-app,
    #wardrobe-app,
    #props-app,
    #artdept-app,
    #reports-app,
    #heatmap-app
  ){
    min-height:0 !important;
    height:100% !important;
    max-height:100% !important;
    margin-top:0 !important;
    top:auto !important;
    align-self:stretch !important;
  }

  body.cbs-phase60 #spatial-app{
    background:linear-gradient(180deg,#f2e7d6,#eadbc3) !important;
    padding:20px !important;
    overflow:auto !important;
  }
}

body.cbs-phase60 .phase60-spatial-shell{
  width:100%;
  display:grid;
  gap:18px;
}
body.cbs-phase60 .phase60-spatial-hero{
  display:grid;
  grid-template-columns:minmax(0,1.6fr) minmax(280px,.8fr);
  gap:18px;
  padding:22px;
  border-radius:24px;
  background:linear-gradient(135deg,rgba(255,249,238,.98),rgba(246,232,205,.96));
  border:1px solid rgba(163,117,58,.20);
  box-shadow:0 18px 36px rgba(63,39,15,.10);
}
body.cbs-phase60 .phase60-spatial-kicker{
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:#9d6b32;
  margin-bottom:8px;
}
body.cbs-phase60 .phase60-spatial-hero h2{margin:0 0 8px;color:#352113}
body.cbs-phase60 .phase60-spatial-hero p{margin:0;color:#6d5640;line-height:1.55}
body.cbs-phase60 .phase60-spatial-hero-stats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}
body.cbs-phase60 .phase60-spatial-hero-stats > div,
body.cbs-phase60 .phase60-spatial-panel{
  background:rgba(255,255,255,.82);
  border:1px solid rgba(165,119,60,.16);
  border-radius:18px;
  padding:16px;
}
body.cbs-phase60 .phase60-spatial-hero-stats strong{display:block;font-size:1.55rem;color:#352113}
body.cbs-phase60 .phase60-spatial-hero-stats span{font-size:.8rem;color:#7a6149}
body.cbs-phase60 .phase60-spatial-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}
body.cbs-phase60 .phase60-spatial-wide{grid-column:1 / -1}
body.cbs-phase60 .phase60-spatial-panel-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:10px;
}
body.cbs-phase60 .phase60-spatial-panel h3{margin:0;color:#352113}
body.cbs-phase60 .phase60-spatial-panel-head span{font-size:.76rem;color:#8a6c50}
body.cbs-phase60 .phase60-spatial-row{
  display:flex;
  justify-content:space-between;
  gap:14px;
  padding:11px 0;
  border-top:1px solid rgba(167,122,63,.12);
}
body.cbs-phase60 .phase60-spatial-row:first-of-type{border-top:none}
body.cbs-phase60 .phase60-spatial-row strong{color:#2e1b10}
body.cbs-phase60 .phase60-spatial-row span{color:#7c664c;text-align:right}
body.cbs-phase60 .phase60-spatial-chip-row{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}
body.cbs-phase60 .phase60-spatial-chip{
  min-width:180px;
  padding:12px 14px;
  border-radius:16px;
  background:linear-gradient(180deg,#fff8ee,#f8ead4);
  border:1px solid rgba(167,122,63,.15);
}
body.cbs-phase60 .phase60-spatial-chip strong{display:block;color:#382415}
body.cbs-phase60 .phase60-spatial-chip span{display:block;margin-top:4px;color:#7d664d;font-size:.8rem}
body.cbs-phase60 .phase60-spatial-empty{color:#8a7257;padding:16px 0}

body.phase60-opening-specialty #writer-app{
  display:none !important;
  visibility:hidden !important;
  opacity:0 !important;
  pointer-events:none !important;
}

body.cbs-phase60 #seriesroom-root .sr55-nav{
  margin-bottom:24px !important;
}

body.cbs-phase60 #seriesroom-root .sr55-body{
  clear:both;
  padding-top:12px !important;
}

body.cbs-phase60 #seriesroom-root .sr55-body > :first-child{
  margin-top:0 !important;
}

@media (max-width: 800px){
  .phase60-guard-grid{grid-template-columns:1fr}
  #callsheet-app .cs-action-bar>*{flex:1 1 140px}
  #callsheet-sheet .cs60-section{padding:12px}
  body.cbs-phase60 #phase60-home-hero{grid-template-columns:1fr;padding:18px}
  body.cbs-phase60 .phase60-home-cta{min-width:0;width:100%}
}

@media (min-width: 1024px){
  body.cbs-phase60 #writer-app .editor-frame{
    padding: 24px 28px 72px !important;
  }

  body.cbs-phase60 #writer-app #pages-container{
    max-width: 932px !important;
    padding-bottom: 160px !important;
    scroll-padding-bottom: 160px !important;
  }

  body.cbs-phase60 #writer-app .script-page-sheet{
    max-width: 872px !important;
    padding: 72px 92px 96px !important;
  }

  body.cbs-phase60 #writer-app .script-page-sheet:last-child{
    margin-bottom: 56px !important;
  }
}

@media (max-width: 760px){
  html[data-ui-tier="phone"] body.cbs-phase60 .view-container > .hidden,
  html[data-ui-tier="phone"] body.cbs-phase60 .view-container > [id$="-app"].hidden{
    display:none !important;
    visibility:hidden !important;
    pointer-events:none !important;
    flex:0 0 0 !important;
    width:0 !important;
    min-width:0 !important;
    max-width:0 !important;
    height:0 !important;
    overflow:hidden !important;
  }

  html[data-ui-tier="phone"] body.cbs-phase60 .view-container > :where(#project-hub, [id$="-app"]):not(.hidden){
    width:100vw !important;
    max-width:100vw !important;
    min-width:0 !important;
    flex:1 1 100% !important;
  }

  html[data-ui-tier="phone"] body.cbs-phase60:not([data-active-view="wardrobe-app"]) #wardrobe-asset-drawer{
    display:none !important;
    visibility:hidden !important;
    pointer-events:none !important;
    flex:0 0 0 !important;
    width:0 !important;
    min-width:0 !important;
    max-width:0 !important;
  }
}
