/* Shared workspace primitives. Theme colors describe roles, not individual screens. */
:root {
  --ws-4:4px; --ws-8:8px; --ws-12:12px; --ws-16:16px; --ws-24:24px; --ws-32:32px;
  --ws-meta: .857143rem; --ws-label: .928571rem; --ws-body: 1rem;
  --ws-title: 1.142857rem; --ws-display: clamp(1.85rem, 2.6vw, 2.43rem);
  --ws-canvas: #f6f7fa; --ws-surface: #fff; --ws-recess: #eff1f5;
  --ws-ink: #1a2030; --ws-secondary: #515c70; --ws-line: #d7dce5;
  --ws-accent: #514098; --ws-tint: #ede9fa; --ws-ring: #6551bd;
  --ws-pad: clamp(16px, 2.7vw, 44px);
}
html[data-theme="dark"] {
  --ws-canvas: #121722; --ws-surface: #1a2130; --ws-recess: #202838;
  --ws-ink: #f0f2f8; --ws-secondary: #b4bed1; --ws-line: #354051;
  --ws-accent: #c2b2ff; --ws-tint: #312c47; --ws-ring: #b9a9ff;
}

html[data-theme] .shell { background: var(--ws-canvas); color: var(--ws-ink); }
.shell .content:not(.team-content) { padding:var(--ws-32) var(--ws-pad) 64px; max-width:1552px; }
.shell .page-head { align-items:center; gap:var(--ws-16); margin-bottom:var(--ws-24); }
.page-head h1, .drawer .detail-title { font-size:var(--ws-display); font-weight:720; line-height:1.15; letter-spacing:-.038em; overflow-wrap:anywhere; }
.page-head h1:last-child { margin:0; }
.shell .eyebrow,.drawer .eyebrow,.nav-label { font-size:var(--ws-meta); letter-spacing:.075em; font-weight:700; }
.page-head .eyebrow { margin:0 0 var(--ws-8); }
.shell .page-head p,.auth-card p { font-size:var(--ws-body); line-height:1.5; }
html[data-theme] .shell :is(.page-head p,.eyebrow,.breadcrumb,.board-summary-text,.stat-bottom,.stat-top,.task-view-caption) { color:var(--ws-secondary); }
.shell .nav a,.shell .project-artist-nav>a { font-size:var(--ws-body); }
.nav a.active .nav-text { font-weight:700; }
html[data-theme] .nav a.active { background:var(--ws-tint); color:var(--ws-accent); }
.shell .workspace-copy small,.shell .profile-info small,.shell .demo-note,.shell .breadcrumb { font-size:var(--ws-meta); }
.shell .workspace-switch { margin-block:var(--ws-24) var(--ws-16); }
.shell .content .button, .drawer .button,.modal .button,.shell .tabs button { font-size:var(--ws-label); font-weight:620; }
.shell .content .button.small,.drawer .button.small { font-size:var(--ws-label); }
html[data-theme] :is(.panel,.calendar-panel,.team-layout,.lead-card,.stat:not(.featured),.task-board-card) { border-color:var(--ws-line); background:var(--ws-surface); }
.panel,.stat,.calendar-panel { border-radius:12px; }
.panel .panel-head { padding:var(--ws-16) var(--ws-24); }
.panel .panel-title,.detail-section h3,.settings-section h3,.task-group-head { font-size:var(--ws-title); font-weight:700; line-height:1.4; margin-block:0; }
.shell :is(.panel-title,.task-copy strong,.agenda-text strong,.lead-name),.drawer .detail-section h3 { color:var(--ws-ink); }
.stats,.finance-balance { gap:var(--ws-12); }
.stat { padding:var(--ws-16); min-height:0; }
.stat .stat-top { margin-bottom:var(--ws-8); font-size:var(--ws-label); font-weight:650; }
.stat .stat-value { font-size:clamp(22px,2vw,32px); font-weight:690; }
.stat .stat-bottom { font-size:var(--ws-meta); margin-top:var(--ws-8); line-height:1.5; }
html[data-theme] .stat.featured :is(.stat-top,.stat-bottom) { color:#ebedf6; }
.shell .toolbar,.shell .board-summary { margin-bottom:var(--ws-16); }
.shell .board-summary-text,.shell .board-summary, .shell .task-view-caption { font-size:var(--ws-label); }
html[data-theme] .shell .project-filter { background:transparent; border:0; border-radius:0; padding:0; margin-bottom:var(--ws-16); align-items:end; }
.project-filter > label { flex:0 1 244px; }
.shell .project-filter-help summary,.workspace-help summary { font-size:var(--ws-label); color:var(--ws-secondary); cursor:pointer; }
.shell .board-navigation { grid-template-columns:minmax(0,224px) 44px 44px; gap:var(--ws-8); margin-bottom:var(--ws-16); }
.board-navigation .board-navigation-hint { grid-column:auto; align-self:center; }
@media(min-width:951px) { .shell .board-navigation { grid-template-columns:minmax(0,224px) 44px 44px minmax(0,1fr); } }
@media(max-width:950px) { .board-navigation .board-navigation-hint { grid-column:1/-1; } }
.shell .column-head .title,.task-board-column>h3 { font-size:var(--ws-label); font-weight:700; }
.shell .kanban { gap:var(--ws-12); padding-bottom:var(--ws-16); min-height:0; }
.shell .kanban-column { padding:var(--ws-8); background:var(--ws-recess); border-radius:12px; min-height:148px; }
.shell .column-head { padding:var(--ws-4) var(--ws-4) var(--ws-12); }
.shell .kanban-column.drag-over { outline:2px dashed var(--ws-ring); outline-offset:-2px; }
.shell .empty-column { padding:var(--ws-16) var(--ws-4); color:var(--ws-secondary); font-size:var(--ws-meta); }
.shell .lead-card,.shell .task-board-card { padding:var(--ws-12); }
.shell .lead-card .card-top,.lead-subtitle,.lead-budget,.lead-tags { margin-bottom:var(--ws-8); }
.shell .lead-name,.task-copy strong,.agenda-text strong,.shell .lead-budget,.shell .task-board-card .task-copy strong { font-size:var(--ws-title); font-weight:680; line-height:1.35; }
.lead-card .lead-subtitle,.lead-card .company-name,.card-next,.task-copy small,.agenda-text small,.data-table small { font-size:var(--ws-meta); line-height:1.45; }
.shell .column-total, .shell .column-add,.shell .request-stage-label,.shell .calendar-weekdays,.calendar-cell .calendar-event small { font-size:var(--ws-meta); }
.lead-card .request-stage-label { margin-top:var(--ws-8); padding-top:var(--ws-8); border-top:0; }
.shell .kanban-column:has([data-request-move]), .shell [data-request-stage] { flex-basis:clamp(208px,19vw,280px); }
.shell .task-view-tabs,.shell .artist-tabs { gap:var(--ws-4); margin:0 0 var(--ws-16); padding:0; display:flex; flex-wrap:wrap; border-bottom:1px solid var(--ws-line); }
html[data-theme] :is(.artist-tabs,.task-view-tabs) > .button {
  color:var(--ws-secondary); background:transparent; box-shadow:none; border:0; border-radius:0; border-bottom:3px solid transparent;
  margin:0; padding:8px 12px; min-height:40px; font-size:var(--ws-label); text-align:center;
}
html[data-theme] :is(.artist-tabs,.task-view-tabs) > .button:is([aria-current="page"],[aria-current="true"]) { color:var(--ws-accent); border-bottom-color:currentColor; font-weight:750; }
html[data-theme] :is(.artist-tabs,.task-view-tabs) > .button:hover { background:var(--ws-tint); }
.artist-shortcuts { margin:var(--ws-12) 0; }
.related-records { border-top:1px solid var(--ws-line); padding-top:var(--ws-12); }
html[data-theme] .related-records a { border:0; background:transparent; box-shadow:none; color:var(--ws-accent); padding-inline:8px; }
.workspace-help { margin-top:var(--ws-16); max-width:72ch; }
.workspace-help p,.form-hint,.bottom-note { font-size:var(--ws-meta); line-height:1.55; }
.artist-section .table-wrap { border:0; border-radius:0; }
.artist-section .agenda-row { padding:var(--ws-12) var(--ws-24); }
.shell .data-table th,.shell .data-table td { padding:var(--ws-12) var(--ws-16); font-size:var(--ws-body); }
.shell .data-table th { font-size:var(--ws-label); letter-spacing:0; }
.artist-section .data-table :is(th,td):not(:first-child) { text-align:right; font-variant-numeric:tabular-nums; }
.data-table small { display:block; }
.shell .link-button { font-size:var(--ws-body); }
.shell .task-table-row { gap:var(--ws-12); padding:var(--ws-12) var(--ws-16); }
.task-table-row .task-meta > span { min-width:0; }
html[data-theme] .task-focus-action .task-focus-button { color:var(--ws-secondary); background:transparent; box-shadow:none; border:1px solid var(--ws-line); font-size:var(--ws-meta); }
html[data-theme] .task-focus-action .task-focus-button[aria-pressed=true] { background:var(--ws-tint); border-color:var(--ws-accent); color:var(--ws-accent); }
.shell .task-filters { padding:var(--ws-12); gap:var(--ws-12); }
.shell .task-filters > label,.field label,.request-stage-label select,.shell .task-meta,.drawer .detail-data .label { font-size:var(--ws-label); }
.task-view-toolbar .task-view-actions { margin-left:auto; }
.shell .agenda-text,.task-copy,.shell .task-table-row { min-width:0; }
.drawer { width:min(560px,100%); }
.drawer .drawer-head,.modal .modal-head { padding:var(--ws-16) var(--ws-24); }
.drawer .drawer-body,.modal .modal-body { padding:var(--ws-24); }
.drawer .detail-subtitle { font-size:var(--ws-body); margin-bottom:var(--ws-16); }
.drawer .detail-actions { gap:var(--ws-8); margin-bottom:var(--ws-16); }
.drawer .detail-section { border-top:0; padding:var(--ws-16) 0; }
.drawer .detail-section + .detail-section { border-top:1px solid var(--ws-line); }
.drawer .detail-section h3 { margin:0 0 var(--ws-12); }
.drawer .detail-data { gap:var(--ws-16); }
.drawer .detail-data .value,.drawer .detail-note,.modal .search-result strong { font-size:var(--ws-body); line-height:1.5; }
.drawer .detail-data button.value { text-align:start; padding:0; text-decoration:underline; text-underline-offset:3px; }
.drawer .detail-section .agenda-row { text-align:start; width:100%; }
.drawer .detail-select,.field :is(input,select,textarea),.shell .task-filters :is(input:not([type=checkbox]),select) { font-size:var(--ws-body); min-height:40px; }
.modal .form-grid { gap:var(--ws-16); }
.modal .field { gap:var(--ws-8); }
#overlay-root .form-hint, #overlay-root .settings-section p { font-size:var(--ws-meta); }
html[data-theme] :is(.shell,#overlay-root,.auth-card) :focus-visible { outline:3px solid var(--ws-ring); outline-offset:2px; }
@media(max-width:760px) {
  .shell .content:not(.team-content) { padding:16px 16px calc(92px + env(safe-area-inset-bottom)); }
  .shell .page-head { flex-wrap:wrap; align-items:center; margin-bottom:var(--ws-16); }
  .shell .task-view-tabs,.shell .artist-tabs { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:thin; }
  .shell .artist-tabs>a { flex-shrink:0; white-space:nowrap; }
  .shell .task-view-tabs > .button,.shell .artist-tabs > .button,.shell .task-focus-action .button,.drawer .button,.shell .content .button, .shell .top-actions .theme-toggle { min-height:44px; }
  .shell .top-actions .theme-toggle { min-width:44px; }
  .shell .task-filters > label { min-width:0; }
  .shell .project-filter:not(.has-project-selection) { display:flex; align-items:center; }
  .shell .task-filters:not(.project-filter) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .shell .task-search-label { grid-column:1/-1; }
  .shell .task-filters .task-focus-option { margin-top:0; align-self:center; }
  .shell .task-table-row { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; }
  .shell .task-list-view .task-meta { grid-column:2; display:flex; width:100%; max-width:100%; justify-content:flex-start; gap:8px; }
  .shell .task-meta .task-focus-action { width:auto; }
  .drawer .drawer-body,.modal .modal-body,.drawer .drawer-head,.modal .modal-head,.panel .panel-head { padding:16px; }
  .shell .task-filters :is(input:not([type=checkbox]),select), .field :is(input,select,textarea),.drawer .detail-select,.auth-card input { font-size:16px; min-height:44px; }
  .shell .kanban-column:has([data-request-move]), .shell [data-request-stage] { flex-basis:min(82vw,300px); }
  .shell .board-navigation { grid-template-columns:minmax(0,1fr) 44px 44px; }
  .shell .data-table th,.shell .data-table td { padding:10px 12px; }
  .stat { padding:12px; }
}
@media(prefers-reduced-motion:reduce) {
  .shell *,#overlay-root * { scroll-behavior:auto; animation-duration:.01ms; transition-duration:.01ms; }
}
.shell .advanced-filter-toggle { display:none; }
.shell .related-records { margin-top:var(--ws-24); }
@media(max-width:760px) {
  .shell .advanced-filter-toggle { display:inline-flex; justify-content:center; align-self:end; }
  #task-filters[data-expanded=false] .advanced-filter { display:none; }
  #task-filters .task-search-label { order:-1; }
  .shell .task-view-toolbar { align-items:center; gap:8px; }
  .shell .task-view-toolbar .tabs { width:auto; }
  .shell .task-view-actions:has(>button:only-child) { width:auto; margin:0; }
  .shell .task-view-actions:has(>button:only-child) button { font-size:12px; }
  .shell .task-view-caption { margin:8px 0; }
  .shell .task-view-caption span:last-child { font-size:12px; }
  .shell .project-filter:not(.has-project-selection)>label { flex:1 1 160px; min-width:0; }
  .shell .project-filter:not(.has-project-selection)>.project-filter-help { flex:1 1 108px; min-width:0; }
  .shell .project-filter:not(.has-project-selection)>.project-filter-help[open] { flex-basis:100%; }
}
@media(max-width:760px) {
  .shell .kanban { margin-inline-end:-16px; padding-inline-end:16px; }
  .shell .task-list-view .task-meta { padding-left:0; }
}
html[data-theme] .kanban-column .column-total { color:var(--ws-secondary); }

/* Browse a stage near its label; pan the board at its trailing edge. */
.shell .board-navigation:not([hidden]) {
  display:flex; align-items:end; justify-content:space-between; gap:var(--ws-12);
}
.board-navigation label { width:min(100%,244px); }
.board-arrows { display:flex; gap:var(--ws-4); align-items:center; }
.board-arrows .board-navigation-arrow { display:inline-grid; place-content:center; line-height:1; font-size:19px; }
.shell .board-navigation[hidden],.view-order-controls[hidden] { display:none; }
/* Reserve a full gutter for the disclosure indicator in native single selects. */
html[data-theme] :is(.shell,#overlay-root,.auth-page) select:not([multiple]):not([size]) {
  appearance:none; padding-inline-end:36px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 6 4.5 4.5L12.5 6' fill='none' stroke='%23515c70' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6'/%3E%3C/svg%3E");
  background-position:right 12px center; background-repeat:no-repeat; background-size:16px 16px;
}
html[data-theme=dark] :is(.shell,#overlay-root,.auth-page) select:not([multiple]):not([size]) {
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 6 4.5 4.5L12.5 6' fill='none' stroke='%23b4bed1' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6'/%3E%3C/svg%3E");
}
@media(forced-colors:active) {
  html[data-theme] :is(.shell,#overlay-root,.auth-page) select:not([multiple]):not([size]) {
    appearance:auto; background-image:none; padding-inline-end:8px;
  }
}
.shell .task-view-tabs { flex-wrap:wrap; overflow:visible; row-gap:var(--ws-4); align-items:stretch; }
.shell .task-view-tabs>[data-task-filter] { cursor:grab; touch-action:pan-y; user-select:none; max-width:100%; white-space:normal; overflow-wrap:anywhere; }
.shell .task-view-tabs.is-ordering>[data-task-filter] { touch-action:none; }
html[data-theme] .task-view-tabs .order-toggle { margin-left:auto; font-size:20px; }
html[data-theme] .task-view-tabs .order-moving { cursor:grabbing; opacity:.7; }
html[data-theme] .task-view-tabs .order-target,
html[data-theme] .task-view-tabs .order-picked,
html[data-theme] .task-view-tabs .order-toggle[aria-expanded=true] { background:var(--ws-tint); color:var(--ws-accent); }
html[data-theme] #view :is(.task-view-tabs,.artist-tabs) :focus-visible { outline-offset:-4px; border-radius:5px; }
.view-order-controls { display:flex; align-items:center; gap:var(--ws-8); margin-bottom:var(--ws-12); }
.view-order-controls [role=status] { color:var(--ws-secondary); font-size:var(--ws-label); }
@media(max-width:760px) {
 .shell #view .task-view-tabs > button,.shell #view .view-order-controls > button { min-width:44px; min-height:44px; }
 .board-arrows { flex-shrink:0; }
 .shell .board-navigation label { min-width:0; width:auto; flex:1; max-width:244px; }
}

/* Requests: a single horizontally scrollable board; the column identifies the stage. */
.shell .request-board {
  display:grid; grid-auto-flow:column; grid-auto-columns:minmax(185px,1fr);
  gap:var(--ws-12); align-items:stretch; overscroll-behavior-x:contain;
  scrollbar-color:var(--ws-secondary) var(--ws-recess); scrollbar-width:auto;
}
.shell .request-board .kanban-column {
  min-width:0; min-height:230px; border-radius:12px;
}
.request-board [data-request-stage=clarifying] { --lane-color:#998fc2; }
.request-board [data-request-stage=proposal] { --lane-color:#c39656; }
.request-board [data-request-stage=director] { --lane-color:#7f87be; }
.request-board [data-request-stage=approved] { --lane-color:#63a38b; }
.request-board [data-request-stage=declined] { --lane-color:#b98489; }
.request-board .column-head { gap:8px; justify-content:flex-start; align-items:baseline; padding:8px 4px 12px; }
.request-board h2 { font-size:var(--ws-body); line-height:1.4; margin:0; color:var(--ws-ink); }
.request-board h2::before { content:""; display:inline-block; width:7px; height:7px; margin-inline-end:7px; border-radius:50%; background:var(--lane-color,#8295af); vertical-align:middle; }
.shell .request-board .count { color:var(--ws-secondary); font-size:var(--ws-meta); font-variant-numeric:tabular-nums; }
.shell .request-board .column-cards { display:grid; align-content:start; gap:8px; }
.shell .request-board .request-card {
  position:relative; padding:12px; margin:0; min-width:0; text-align:start;
  touch-action:pan-x pan-y; overflow-wrap:anywhere; transition:border-color .12s;
}
.shell .request-board .request-card:hover { transform:none; border-color:var(--ws-secondary); }
.request-card-head,.request-card-foot,.request-facts { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.request-source,.request-meta,.request-facts { font-size:var(--ws-meta); line-height:1.45; color:var(--ws-secondary); }
.request-card-head { margin-bottom:4px; }
.request-grip { width:28px; height:28px; margin:-6px -5px -4px 0; flex:none; display:grid; place-items:center; touch-action:none; cursor:grab; color:var(--ws-secondary); }
.request-grip::after { content:""; width:10px; height:16px; background:radial-gradient(circle,currentColor 1.45px,transparent 1.65px) left top/5px 5px; }
.request-card .lead-name { margin:0; }
.request-meta,.request-artist,.request-facts:not(:empty) { margin-top:8px; }
.request-artist,.request-facts>span,.request-transfer>span { display:inline-flex; gap:5px; align-items:center; }
.request-artist { color:var(--ws-accent); font-size:var(--ws-label); font-weight:600; }
.request-artist svg,.request-facts svg,.request-transfer svg { width:14px; height:14px; flex:none; }
.request-facts { flex-wrap:wrap; }
.request-facts strong { color:var(--ws-ink); }
.request-card-foot { margin-top:8px; padding-top:4px; border-top:1px solid var(--ws-line); }
.request-transfer { position:relative; display:inline-grid; place-items:center; color:var(--ws-secondary); font-size:var(--ws-meta); min-height:32px; }
.request-transfer select { position:absolute; inset:0; width:100%; min-height:0; height:100%; opacity:0; cursor:pointer; }
.request-transfer:focus-within { outline:2px solid var(--ws-ring); outline-offset:2px; border-radius:3px; }
.shell .request-board .empty-column { padding:16px 4px; text-align:start; }
@media(min-width:761px) {
  .request-board .column-cards { max-height:max(280px,calc(100dvh - 315px)); overflow-y:auto; padding:3px; }
}
@media(max-width:760px) {
  .shell .request-board { grid-auto-columns:min(82vw,305px); }
  .request-transfer,.request-grip { min-height:44px; }
  .request-grip { width:44px; }
}
@media(forced-colors:active) {
  .request-grip::after { content:"⠿"; width:auto; height:auto; }
}

/* A short or empty column is a valid destination across the full board height. */
.shell #kanban { align-items:stretch; }
:is(.kanban,.task-board) :is([data-lead],[data-request],[data-task-card]) {
  -webkit-user-select:none; user-select:none;
}
html[data-theme] .shell :is(.kanban,.task-board).board-in-drag { scroll-snap-type:none; cursor:grabbing; }
html[data-theme] .board-in-drag .dragging { opacity:.42; transform:none; }
html[data-theme] .board-in-drag .drag-over { outline:2px solid var(--ws-ring); outline-offset:-2px; background:var(--ws-tint); }
html[data-theme] .board-in-drag .board-insert-before { box-shadow:0 -3px 0 var(--ws-ring); }
html[data-theme] .board-in-drag .board-insert-after { box-shadow:0 3px 0 var(--ws-ring); }
@media (pointer:fine) {
  .task-board-card,.task-board-card .task-copy { cursor:grab; }
}
.board-drag-preview {
  position:fixed; left:0; top:0; z-index:10000; pointer-events:none; user-select:none;
  width:max-content; max-width:min(245px,70vw); padding:8px 14px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; border-radius:8px;
  background:var(--ws-surface); color:var(--ws-ink); border:1px solid var(--ws-ring);
  box-shadow:0 5px 18px #10152829; font-size:var(--ws-label); font-weight:650;
}
