body.work-space { min-height: 100vh; display: flow-root; color: #f2f4ee; background: #121513; }
.work-space > header { background: #101310; border-bottom: 1px solid #313731; }
.work-space main { width: min(92%, 1180px); margin: clamp(1rem, 3vw, 2.5rem) auto 3rem; }
.work-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: end; padding: clamp(22px, 4vw, 52px);
  border-radius: 18px; min-height: clamp(208px, 24vw, 285px); background: #151a1e;
}
.work-hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg,#121716 5%,#121716d9 31%,#141a1850 65%,transparent),
    url('/ui/studio-city.webp') right 55% / cover no-repeat;
}
.work-hero h1 { margin: 0; font-weight: 600; font-size: clamp(2.4rem,5vw,4rem); letter-spacing: -.045em; }
.work-hero p { color: #ecefe7; margin: .25rem 0 1.25rem; }
.work-space .work-primary, .work-space form button:not([type=button]) {
  border-radius: 30px; padding: .55rem 1.15rem; border-color: #daf2b2; background: #daf2b2; color: #172119; font-weight: 650;
}
.work-space .work-primary:hover { background: #e7facb; }
.library-head { margin: 2rem 0 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.library-head h2 { margin: 0; font-weight: 600; }
#film-search { border-radius: 30px; width: min(100%,16rem); }
.film-library { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(230px,100%),1fr)); gap: 16px; }
.film-tile { display: block; border: 1px solid #343b36; border-radius: 14px; overflow: hidden; background: #1c211e; color: #f3f6ee; text-decoration: none; }
.film-tile[hidden] { display: none; }
.film-tile:hover, .film-tile:focus-visible { border-color: #b9d79f; }
.film-cover { display: flex; position: relative; align-items: end; height: 128px; padding: 18px; background: linear-gradient(118deg,#2c4d43,#263638 62%,#567668); }
.palette-1 { background: linear-gradient(115deg,#283b50,#34364d 65%,#4a626e); }
.palette-2 { background: linear-gradient(115deg,#684332,#422f30 65%,#704d3e); }
.palette-3 { background: linear-gradient(115deg,#534263,#3a344a 65%,#635671); }
.film-cover::before { content: ''; position: absolute; top: 14px; left: 18px; width: 36px; height: 4px; background: repeating-linear-gradient(90deg,#fff5 0 6px,transparent 6px 10px); }
.film-cover h3 { margin: 0; font-size: 1.3rem; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.film-caption { display: flex; justify-content: space-between; padding: 14px 18px 0; font-size: .87rem; color: #d2e1cd; }
.film-tile p { margin: .35rem 18px 18px; color: #b8c0b8; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.library-empty { padding: 1.35rem; border: 1px dashed #4a554c; border-radius: 14px; }
.library-empty h3 { margin: 0; }.library-empty p { margin: .35rem 0 0; color: #c1cbc2; }
.employee-code { margin-top: 1.5rem; color: #bac4b9; }
.employee-code summary, .team-fold summary { width: fit-content; min-height: 44px; }
.work-space main section, .work-space #new-film { color: inherit; background: #1c211e; border: 1px solid #384239; }
.work-space main input, .work-space main textarea, .work-space main select { color: #f2f5ed; background: #141915; border-color: #59675b; }
.work-space main input::placeholder { color: #b0bcaf; }
.work-space main small { color: #b7c4b5; }
.work-space main button:not(.work-primary):not(form button:not([type=button])) { background: #232b25; color: #eaf2e6; border-color: #566258; }
.work-space main pre, .work-space main code { background: #101612; color: #d6e3d4; }
.work-space main pre { padding: 1rem; border-radius: 10px; }
.work-space #new-film { width: min(440px,calc(100% - 24px)); padding: 24px; border-radius: 16px; }
#new-film::backdrop { background: #060906ac; }
#new-film .end { justify-content: end; }
.create-error:empty { display: none; }
.work-space .create-error { color: #ffc9b5; }
.work-space main :focus-visible { outline: 3px solid #d4eba9; outline-offset: 2px; }
@media(max-width: 600px) {
  .work-hero::before { background-position: center, 58% center; }
  .library-head { margin-top: 1.4rem; }
  #film-search { width: 100%; }
}
.film-tabs { display:flex; flex-wrap:wrap; gap:.75rem 1.25rem; padding:.75rem 0; }
.film-tabs a[aria-current="page"] { font-weight:700; text-decoration:underline; }
.chat-turn { margin:1rem 0; padding-top:1rem; border-top:1px solid #59645b; }
.chat-turn p { white-space:pre-wrap; overflow-wrap:anywhere; }
.work-space main details + details { margin-top:.75rem; }

.film-tabs { align-items:center; }
.film-chat-link { display:inline-block; text-decoration:none; }
.chat-layout-controls {
  display:flex; flex-wrap:wrap; gap:.5rem; margin:.25rem 0 1rem;
}
.work-space main .chat-layout-controls button {
  min-height:44px; padding:.45rem .8rem; border-radius:8px;
}
.work-space main .chat-layout-controls button:not(.work-primary)[aria-pressed="true"] {
  background:#daf2b2; color:#172119; border-color:#daf2b2;
}
.film-chat-layout { display:grid; gap:.8rem; align-items:start; }
.film-chat-layout > * { min-width:0; }
.film-chat-layout > [hidden] { display:none; }
.film-chat-panel textarea { min-height:6rem; }
.chat-separator { display:none; }
.chat-message-history {
  max-height:min(56vh,38rem); overflow-y:auto; margin-top:.8rem; padding-inline:.3rem .85rem;
  border-top:1px solid #384239; overscroll-behavior:contain;
}
.chat-message-history .chat-turn:first-child { border-top:0; margin-top:0; }
.chat-message-history pre { white-space:pre-wrap; overflow-wrap:anywhere; }
.chat-message-history + form { margin-top:1rem; }
@media (min-width:960px) {
  .film-chat-workspace[data-mode="split"] .film-chat-layout {
    grid-template-columns:minmax(0,1fr) 20px minmax(0,min(var(--chat-aside-width,38%),max(0px,calc(100% - 280px)))); gap:0;
  }
  .film-chat-workspace[data-mode="split"] .chat-separator {
    display:grid; place-items:center; height:76px; position:sticky; top:1rem; cursor:col-resize; touch-action:none;
  }
  .chat-separator::before {
    content:""; width:4px; height:3.5rem;
    border-radius:4px; background:#778778;
  }
  .chat-separator:hover::before,.chat-separator:focus-visible::before,.is-resizing .chat-separator::before {
    background:#c9e6a9;
  }
  .is-resizing { user-select:none; cursor:col-resize; }
}

.customer-actions { display:flex; flex-wrap:wrap; gap:.6rem; }
.work-space form .customer-actions button:disabled {
  background:#303a31; color:#bbc4bc; border-color:#59675b; cursor:not-allowed;
}
.customer-steps {
  display:flex; flex-wrap:wrap; gap:.55rem; list-style:none; padding:0; margin:1rem 0;
}
.customer-steps li {
  color:#c1cbc2; border:1px solid #4a554c; padding:.35rem .65rem; border-radius:6px;
}
.customer-steps li.is-complete::before { content:"✓ "; }
.customer-steps li[aria-current="step"] {
  color:#172119; background:#daf2b2; border-color:#daf2b2; font-weight:650;
}
.review-option { display:flex; align-items:center; gap:.5rem; }
.review-option input { width:auto; }
.work-space main a:not(.work-primary):not(.film-tile) { color:#bbdfac; }
.work-space main a:not(.work-primary):not(.film-tile):hover { color:#e7facb; }
.work-space main .film-tabs a[aria-current="page"]:not(.work-primary) { color:#f1f7e9; }
.work-space main form button.customer-secondary {
  color:#eaf2e6; background:#232b25; border-color:#728477;
}

.chat-aside-controls { display:flex; flex-wrap:wrap; gap:.45rem; margin-bottom:.55rem; }
.work-space main .chat-aside-controls button { min-height:44px; border-radius:8px; }
.work-space main .chat-aside-controls button:not(.work-primary)[aria-pressed="true"] {
  background:#daf2b2; color:#172119; border-color:#daf2b2;
}
.chat-general-link { display:block; padding:.55rem .75rem; margin-bottom:.65rem; border:1px solid #59675b; border-radius:8px; }
.chat-general-link[aria-current="page"],.chat-session-list a[aria-current="page"] { background:#293b2b; border-color:#91ad81; }
.chat-session-list { list-style:none; padding:0; display:grid; gap:.45rem; }
.chat-session-list a { display:block; padding:.55rem .75rem; border:1px solid #384239; border-radius:8px; overflow-wrap:anywhere; }
.chat-session-list small { display:block; margin-top:.2rem; }
.new-conversation { margin-bottom:.65rem; }
.new-conversation summary { cursor:pointer; color:#e1f1d5; padding:.5rem 0; }
.chat-active-title { color:#d0dec8; font-weight:650; }

.work-pending ul { list-style:none; display:grid; gap:.5rem; padding:0; margin:.7rem 0 0; }
.work-space main .work-pending li a {
  display:block; padding:.75rem 1rem; border:1px solid #46564a; border-radius:9px;
  background:#222d25; color:#e0f0d7; text-decoration:none;
}
.work-space main .work-pending li a:hover { border-color:#b9d79f; background:#293a2c; }

.wallet-page { max-width:850px; }
.wallet-page h1 { font-size:clamp(2rem,4vw,2.7rem); margin:.45rem 0 1.25rem; }
.wallet-amounts { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:1rem; }
.wallet-amounts div { display:grid; gap:.1rem; }
.wallet-amounts strong { font-size:2rem; color:#daf2b2; }
.wallet-amounts span,.wallet-balance p { color:#c1cbc2; }
.wallet-balance p { margin:1rem 0 0; }
.wallet-entries { list-style:none; padding:0; margin:0; }
.wallet-entries li { display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap; padding:.85rem 0; border-bottom:1px solid #384239; }
.wallet-entries li:last-child { border:0; }
.wallet-entries li div { display:grid; gap:.2rem; }
.wallet-entries li span { color:#c1cbc2; }
