:root {
  --work-border: rgba(229, 192, 101, .22);
  --work-surface: #111311;
  --work-surface-2: #181a17;
  --work-highlight: #e8c36b;
  --work-danger: #ff9f94;
  --work-success: #8be0ae;
  --work-focus: #f7d978;
  --work-focus-ring: rgba(247, 217, 120, .28);
  --work-shadow-soft: 0 12px 34px rgba(0, 0, 0, .22);
}

/* Author display rules (grid/flex) can override the browser's default
   [hidden] rule. Filtering relies on hidden as the single source of truth. */
.collab-mode [hidden] { display: none !important; }

/* Keep controls legible and keyboard-friendly across the long workbench views. */
.collab-mode :where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--work-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--work-focus-ring);
}
.collab-mode :where(input, select, textarea) { accent-color: var(--work-highlight); }
.collab-mode :where(input, select, textarea)::placeholder { color: #817967; opacity: 1; }
.collab-mode :where(button, a, input, select, textarea) { -webkit-tap-highlight-color: transparent; }
.collab-mode button:disabled { cursor: not-allowed; filter: saturate(.55); }

@keyframes workbench-spin {
  to { transform: rotate(360deg); }
}

.workbench-view { margin-top: 0; }
.collab-mode .topbar { box-shadow: 0 8px 26px rgba(0, 0, 0, .16); }
.collab-mode .topbar .brand { min-width: 0; }
.collab-mode .topbar .brand > div:last-child { min-width: 0; line-height: 1.25; }
.collab-mode .topbar .brand small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workbench-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 16px; }
.workbench-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.workbench-head h2 { font-size: 21px; }
.workbench-actions, .node-actions, .batch-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.workbench-actions .btn, .node-actions .btn, .batch-actions .btn { min-height: 39px; }
.workbench-actions .btn, .node-actions .btn, .batch-actions .btn, .workbench-head-actions .btn { transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.workbench-actions .btn:hover, .node-actions .btn:hover, .batch-actions .btn:hover, .workbench-head-actions .btn:hover { transform: translateY(-1px); box-shadow: var(--work-shadow-soft); }
.workbench-layout { display: grid; grid-template-columns: minmax(265px, .42fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.workbench-sidebar { position: sticky; top: 91px; max-height: calc(100vh - 112px); overflow: hidden; display: flex; flex-direction: column; padding: 0; border-radius: 14px; box-shadow: var(--work-shadow-soft); }
.workbench-sidebar-head { padding: 17px 17px 12px; border-bottom: 1px solid var(--work-border); }
.workbench-sidebar-head h3 { margin: 0; font-size: 15px; }
.workbench-sidebar-filter { margin-top: 11px; }
.workbench-sidebar-priority { margin-top: 8px; color: #f0d27c; font-weight: 750; }
.node-filter-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 29px; margin-top: 7px; color: #a79d8a; font-size: 11px; }
.node-filter-status button { border: 0; background: transparent; color: #edc967; font-weight: 750; padding: 4px 0; }
.node-filter-empty { margin: 8px; padding: 26px 14px; border: 1px dashed #51482f; border-radius: 9px; text-align: center; color: #d8cdaF; }
.node-filter-empty b, .node-filter-empty small { display: block; }
.node-filter-empty small { margin-top: 5px; color: var(--muted); line-height: 1.55; }
.workbench-node-list { overflow: auto; padding: 8px; scrollbar-gutter: stable; overscroll-behavior: contain; }
.workbench-node { width: 100%; min-height: 58px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink); display: grid; grid-template-columns: 1fr auto; gap: 8px; text-align: left; padding: 10px; transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.workbench-node:hover { background: #1b1e1a; border-color: var(--work-border); transform: translateX(2px); }
.workbench-node.selected { background: linear-gradient(90deg, rgba(226, 189, 97, .2), rgba(42, 37, 23, .84)); border-color: rgba(232, 195, 107, .58); box-shadow: inset 3px 0 0 var(--work-highlight), 0 5px 18px rgba(0, 0, 0, .16); }
.workbench-node.priority-p0 { border-left: 3px solid #f2cf70; background: linear-gradient(90deg, rgba(221, 174, 67, .19), rgba(38, 34, 23, .52)); }
.workbench-node.priority-p1 { border-left: 3px solid #b9d98d; background: linear-gradient(90deg, rgba(125, 168, 99, .13), rgba(28, 34, 27, .48)); }
.workbench-node.priority-p2 { border-left: 3px solid #87b9d8; background: linear-gradient(90deg, rgba(80, 131, 169, .13), rgba(25, 31, 34, .48)); }
.workbench-node.priority-p0 b, .workbench-node.priority-p1 b, .workbench-node.priority-p2 b { font-weight: 900; }
.workbench-node.priority-p0 em { color: #ffe49b; background: rgba(229, 182, 72, .2); }
.workbench-node.priority-p1 em { color: #d9f0b5; background: rgba(133, 181, 103, .17); }
.workbench-node.priority-p2 em { color: #c4e7fb; background: rgba(89, 150, 194, .17); }
.workbench-node.priority-p0 em, .workbench-node.priority-p1 em, .workbench-node.priority-p2 em { border-radius: 4px; padding: 2px 5px; font-weight: 900; }
.workbench-node b { display: block; font-size: 12px; line-height: 1.45; }
.workbench-node small { display: block; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.workbench-node .work-count { color: #efd17e; white-space: nowrap; align-self: center; font-size: 11px; }
.workbench-node .work-draft-dot { width: 7px; height: 7px; align-self: center; background: var(--work-success); box-shadow: 0 0 0 4px rgba(139, 224, 174, .12); border-radius: 50%; }
.workbench-node .work-node-meta { display: flex; gap: 5px; align-items: center; justify-content: flex-end; }
.top-actions .btn:disabled { cursor: wait; opacity: .65; }
.workbench-main { min-height: 690px; border-radius: 14px; box-shadow: var(--work-shadow-soft); }
.workbench-empty { display: grid; min-height: 510px; place-items: center; text-align: center; color: var(--muted); padding: 32px; border: 1px dashed var(--work-border); border-radius: 8px; background: rgba(22, 24, 21, .7); }
.workbench-empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.node-editor-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 15px; border-bottom: 1px solid var(--work-border); }
.node-editor-title { min-width: 0; }
.node-editor-title h3 { margin: 0; font-size: 18px; word-break: break-word; }
.node-editor-title .sub { max-width: 760px; }
.node-editor-kpis { display: flex; flex-wrap: wrap; gap: 7px; align-content: start; justify-content: flex-end; }
.work-kpi { padding: 6px 8px; border: 1px solid #3b392f; background: #20211d; border-radius: 7px; color: #d5c9ac; white-space: nowrap; font-size: 11px; }
.work-kpi b { color: #f3d271; }
.work-platforms { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding: 12px 13px; margin-top: 13px; border: 1px solid rgba(229, 192, 101, .14); border-radius: 9px; background: rgba(218, 176, 76, .045); color: #ddd1b6; font-size: 13px; }
.work-platforms strong { color: var(--muted); font-size: 12px; }
.work-platforms label { display: inline-flex; gap: 6px; align-items: center; min-height: 28px; padding: 3px 8px; border: 1px solid transparent; border-radius: 6px; transition: background .16s ease, border-color .16s ease; }
.work-platforms label:hover { border-color: var(--work-border); background: rgba(255, 255, 255, .035); }
.work-validation { margin: 15px 0; display: grid; gap: 7px; }
.work-validation .work-alert { border: 1px solid rgba(235, 117, 108, .36); background: rgba(115, 35, 31, .24); color: #ffc3bb; padding: 10px 12px; border-radius: 7px; font-size: 12px; line-height: 1.5; }
.work-validation .work-note { border: 1px solid rgba(139, 224, 174, .25); background: rgba(33, 104, 65, .17); color: #b8edcc; padding: 10px 12px; border-radius: 7px; font-size: 12px; line-height: 1.5; }
.node-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, .42fr); gap: 16px; margin-top: 16px; }
.editor-section { border: 1px solid var(--work-border); background: var(--work-surface); border-radius: 9px; overflow: hidden; box-shadow: 0 4px 16px rgba(0, 0, 0, .12); }
.editor-section-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 14px; border-bottom: 1px solid var(--work-border); }
.editor-section-head h4 { margin: 0; font-size: 14px; }
.editor-section-head .sub { margin-top: 3px; }
.editor-section-body { padding: 13px; }
.book-editor-toolbar { display: grid; grid-template-columns: minmax(170px, 1fr) auto auto; gap: 9px; margin-bottom: 11px; }
.work-book-list { max-height: 490px; overflow: auto; border-top: 1px solid #2e302b; scrollbar-gutter: stable; overscroll-behavior: contain; }
.work-book-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 74px 58px; align-items: center; gap: 8px; min-height: 48px; padding: 9px 5px; border-bottom: 1px solid #292b27; font-size: 12px; transition: background .14s ease; }
.work-book-row:hover { background: rgba(226, 189, 97, .045); }
.work-book-row.removed { opacity: .48; text-decoration: line-through; }
.work-book-row.added { background: rgba(71, 143, 94, .12); }
.work-book-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e6ddc9; }
.work-book-title small { display: block; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; margin-top: 2px; }
.book-state { justify-self: end; font-size: 10px; color: #b8ae9b; }
.book-state.add { color: var(--work-success); }
.book-state.remove { color: var(--work-danger); }
.work-add-box { display: grid; gap: 9px; }
.work-add-box textarea { min-height: 92px; }
.slot-search { display: grid; gap: 5px; margin-bottom: 12px; }
.slot-search small { color: var(--muted); font-size: 11px; }
.slot-editor { display: grid; gap: 8px; }
.slot-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; align-items: center; }
.slot-row label { color: var(--muted); font-size: 12px; }
.slot-row select { min-width: 0; }
.slot-change { display: block; color: #f0cb72; font-size: 10px; margin-top: 3px; }
.batch-summary { margin-top: 16px; }
.batch-summary-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.batch-summary-head h3 { margin: 0; font-size: 15px; }
.batch-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 12px; }
.batch-stat { border: 1px solid #38362d; background: #171916; padding: 11px; border-radius: 7px; }
.batch-stat b { display: block; color: #efc86d; font-size: 21px; }
.batch-stat span { font-size: 11px; color: var(--muted); }
.batch-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px; border: 1px solid #38362e; background: #171916; border-radius: 7px; margin-top: 8px; }
.batch-row b { font-size: 13px; }
.batch-row small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.5; }
.batch-row-actions { display: flex; gap: 7px; align-items: start; }
.work-compact { padding: 7px 9px; min-height: 32px; font-size: 11px; }
.work-badge { display: inline-flex; align-items: center; gap: 5px; border: 1px solid rgba(229, 192, 101, .28); background: #342b18; border-radius: 999px; padding: 3px 7px; color: #efca70; font-size: 10px; }
.work-badge.good { border-color: rgba(139, 224, 174, .28); color: var(--work-success); background: rgba(28, 84, 49, .32); }
.work-badge.danger { border-color: rgba(255, 159, 148, .3); color: var(--work-danger); background: rgba(102, 37, 34, .34); }
.work-toast { position: fixed; z-index: 100; right: 18px; bottom: 18px; max-width: min(420px, calc(100vw - 36px)); padding: 12px 14px; border: 1px solid rgba(229, 192, 101, .42); background: #23231d; color: #f7e6b8; box-shadow: var(--shadow); border-radius: 8px; font-size: 13px; transform: translateY(18px); opacity: 0; transition: .2s; pointer-events: none; }
.work-toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1100px) {
  .workbench-layout { grid-template-columns: 1fr; }
  .workbench-sidebar { position: static; max-height: 300px; }
  .node-editor-grid { grid-template-columns: 1fr; }
}

@media (max-width: 690px) {
  .workbench-head, .node-editor-head { flex-direction: column; }
  .workbench-head-actions { width: 100%; justify-content: flex-start; }
  /* index.html hides regular header buttons on small screens; the active-session
     logout control must remain reachable in the collaboration workspace. */
  .collab-mode .top-actions .btn[data-action="logout"] { display: inline-flex !important; flex: 0 0 auto; min-height: 34px; padding: 7px 9px; font-size: 11px; white-space: nowrap; }
  .collab-mode .user-chip { max-width: 136px; overflow: hidden; text-overflow: ellipsis; }
  .node-editor-kpis { justify-content: flex-start; }
  .workbench-actions { width: 100%; }
  .workbench-actions .btn { flex: 1 1 130px; }
  .book-editor-toolbar { grid-template-columns: 1fr 1fr; }
  .book-editor-toolbar input { grid-column: 1 / -1; }
  .work-book-row { grid-template-columns: 25px minmax(0, 1fr) 48px; }
  .work-book-row .work-order { display: none; }
  .batch-summary-grid { grid-template-columns: 1fr 1fr; }
  .batch-row { grid-template-columns: 1fr; }
}

/* Shared workflow views */
.collab-mode .footer { margin-top: 24px; }
.collab-mode main { min-height: 600px; }
.collab-hero { margin-bottom: 24px; }
.system-hero { min-height: 108px; display: flex; align-items: center; padding: 26px 32px; }
.system-hero h1 { margin: 0; font-size: 28px; }
.system-hero h1 span { color: #e9c76f; font-size: 16px; font-weight: 800; }
.collab-tabs { display: flex; gap: 7px; overflow: auto; margin: 0 0 17px; padding: 5px; border: 1px solid var(--work-border); background: #141611; border-radius: 10px; }
.collab-tab { border: 0; background: transparent; color: var(--muted); padding: 10px 14px; border-radius: 7px; font-weight: 800; white-space: nowrap; }
.collab-tab.active { color: #f2ce70; background: #332b18; }
.collab-tab .tab-count { display: inline-grid; min-width: 18px; height: 18px; margin-left: 3px; padding: 0 4px; place-items: center; border: 1px solid rgba(232, 195, 107, .35); border-radius: 999px; color: #f6d886; background: rgba(232, 195, 107, .12); font-size: 10px; line-height: 1; }
.collab-view { min-height: 580px; }
.workbench-content { min-width: 0; }
.context-bar { display: grid; grid-template-columns: minmax(220px, 1.3fr) repeat(4, minmax(145px, .7fr)); gap: 12px; align-items: end; margin-bottom: 14px; padding: 15px 17px; }
.context-bar > div { align-self: center; }
.context-bar strong { display: block; color: #f0d27e; font-size: 15px; }
.context-bar small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.context-bar label { display: grid; gap: 5px; color: #cfc3a7; font-size: 11px; font-weight: 750; }
.context-bar .field { min-height: 39px; padding: 8px 10px; }
.context-bar .field:disabled { color: #9e9685; opacity: .75; cursor: not-allowed; }
.delivery-status { margin: 0 0 18px; padding: 16px 17px; border: 1px solid rgba(229, 192, 101, .2); border-radius: 12px; background: linear-gradient(135deg, rgba(218, 176, 76, .08), rgba(17, 20, 17, .86) 54%, rgba(27, 40, 31, .48)); box-shadow: var(--work-shadow-soft); }
.delivery-status-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.delivery-status-head h3 { margin: 0; color: #f2d781; font-size: 17px; }
.delivery-status-head p:not(.app-kicker) { max-width: 780px; margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.delivery-status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }
.delivery-status-card { min-width: 0; padding: 11px 12px; border: 1px solid #36382f; border-radius: 8px; background: rgba(16, 18, 16, .66); }
.delivery-status-card.good { border-color: rgba(139, 224, 174, .27); background: rgba(33, 104, 65, .12); }
.delivery-status-card.waiting { border-color: rgba(234, 199, 106, .24); }
.delivery-status-card > span { display: block; color: #b9ad94; font-size: 10px; }
.delivery-status-card > b { display: block; margin-top: 4px; color: #f0d27e; font-size: 14px; }
.delivery-status-card.good > b { color: var(--work-success); }
.delivery-status-card > small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.delivery-next { display: flex; gap: 12px; align-items: flex-start; margin-top: 13px; padding-top: 11px; border-top: 1px solid rgba(229, 192, 101, .14); color: #d6c9ad; font-size: 11px; line-height: 1.55; }
.delivery-next > strong { flex: 0 0 auto; color: #e9c76f; font-size: 11px; }
.delivery-next ol { display: grid; gap: 3px; margin: 0; padding-left: 18px; color: var(--muted); }
.delivery-next li::marker { color: #d7b85f; }
.source-snapshots { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; padding: 10px 12px; border: 1px solid rgba(229, 192, 101, .16); background: rgba(218, 176, 76, .05); border-radius: 7px; }
.source-snapshots > strong { color: #d9bd72; font-size: 11px; }
.source-snapshots > span { display: inline-flex; gap: 6px; align-items: baseline; min-width: 0; }
.source-snapshots b { color: #f0d27e; font-size: 10px; }
.source-snapshots small { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.browse-head { align-items: flex-start; }
.browse-kpis { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.browse-kpis span { min-width: 112px; padding: 9px 11px; border: 1px solid var(--work-border); background: #171916; border-radius: 7px; color: var(--muted); font-size: 10px; }
.browse-kpis b { display: block; margin-bottom: 2px; color: #f0d27e; font-size: 16px; }
.browse-details { min-width: 0; }
.browse-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; margin: 2px 0 12px; }
.browse-book-table { overflow: auto; max-height: 690px; border: 1px solid #34352f; border-radius: 9px; scrollbar-gutter: stable; overscroll-behavior: contain; box-shadow: inset 0 1px rgba(255, 255, 255, .015); }
.browse-book-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.browse-book-table th { position: sticky; top: 0; z-index: 1; padding: 10px 12px; text-align: left; color: #b8ad96; background: #1d1f1c; border-bottom: 1px solid #3d3b33; font-size: 10px; letter-spacing: .04em; }
.browse-book-table td { padding: 10px 12px; border-bottom: 1px solid #2e302b; color: #d8cdb6; vertical-align: middle; }
.browse-book-table tr:last-child td { border-bottom: 0; }
.browse-book-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, .014); }
.browse-book-table tbody tr:hover { background: rgba(226, 189, 97, .075); }
.browse-book-table td:first-child { width: 64px; color: #948a78; }
.browse-book-table td:last-child { width: 120px; }
.browse-book-table td b { display: block; color: #f1e2c3; font-size: 12px; }
.browse-book-table td small { display: block; margin-top: 3px; color: #9e927c; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.browse-book-table .empty { margin: 12px; }
.app-kicker { color: #e9c76f; margin: 0 0 5px; font-size: 10px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.node-group + .node-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--work-border); }
.node-group-title { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; color: #edcf7b; font-size: 11px; font-weight: 850; }
.node-group-title span { color: var(--muted); font-weight: 600; }
.workbench-node em { color: #f3d271; font-size: 10px; font-style: normal; }
.slots-panel { margin-top: 16px; }
.shared-batch { border: 1px solid #38362e; background: linear-gradient(145deg, #171916, #131512); border-radius: 10px; padding: 15px; margin-top: 10px; box-shadow: 0 5px 18px rgba(0, 0, 0, .12); }
.shared-batch-head { display: flex; justify-content: space-between; gap: 14px; }
.shared-batch h3 { margin: 0; font-size: 15px; }
.shared-batch p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.batch-name-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.status-pill { display: inline-flex; align-items: center; border: 1px solid #494338; border-radius: 999px; padding: 3px 8px; color: #c5b99f; background: #24241f; font-size: 10px; font-weight: 850; }
.status-pill.good { border-color: rgba(119, 220, 161, .3); color: var(--work-success); background: rgba(33, 104, 65, .2); }
.status-pill.bad { border-color: rgba(255, 159, 148, .3); color: var(--work-danger); background: rgba(102, 37, 34, .25); }
.status-pill.waiting { border-color: rgba(234, 199, 106, .36); color: #f1ce78; background: #342b18; }
.audit-line { display: grid; gap: 4px; margin-top: 12px; border-top: 1px solid #303129; padding-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.audit-line b { color: #e0d2b3; }
.review-note { margin-top: 11px; padding: 9px 10px; border-radius: 6px; background: rgba(218,176,76,.08); border: 1px solid rgba(229, 192, 101, .18); color: #e7d7b5; font-size: 12px; line-height: 1.5; }
.batch-list { display: grid; gap: 1px; }
.batch-detail { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--work-border); }
.batch-detail-list { display: grid; gap: 10px; }
.batch-detail-node { padding: 12px; border: 1px solid #3a392f; background: #121411; border-radius: 7px; }
.batch-detail-node-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 9px; border-bottom: 1px solid #2e302b; }
.batch-detail-node-head b { display: block; color: #f0d27e; font-size: 12px; }
.batch-detail-node-head > div > span { display: block; margin-top: 4px; color: #e0d5bd; font-size: 12px; line-height: 1.45; }
.batch-detail-counts { color: var(--muted); font-size: 11px; white-space: nowrap; }
.batch-detail-meta { display: grid; grid-template-columns: minmax(170px, 1.4fr) repeat(3, minmax(90px, .7fr)); gap: 9px; margin-top: 10px; color: #d3c6a9; font-size: 11px; }
.batch-detail-meta span, .batch-detail-snapshots span { min-width: 0; }
.batch-detail-meta b, .batch-detail-snapshots > b { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 700; }
.batch-detail-meta code { overflow-wrap: anywhere; color: #f0d27e; font-size: 10px; }
.batch-detail-snapshots { display: flex; flex-wrap: wrap; gap: 9px 15px; margin-top: 11px; padding: 9px 10px; background: rgba(218, 176, 76, .05); border: 1px solid rgba(229, 192, 101, .14); border-radius: 6px; color: #d9c8a5; font-size: 11px; }
.batch-detail-snapshots > b { flex: 0 0 100%; margin: 0; }
.batch-detail-snapshots strong { color: #f0d27e; font-size: 10px; }
.batch-detail-snapshots small { display: block; margin-top: 3px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; overflow-wrap: anywhere; }
.batch-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 11px; }
.batch-detail-grid section { min-width: 0; padding: 9px 10px; border: 1px solid #2f312c; border-radius: 6px; background: #171916; }
.batch-detail-grid h5 { margin: 0 0 7px; color: #dfd2b4; font-size: 11px; }
.batch-detail-grid h5 em { color: #efca70; font-style: normal; font-weight: 800; }
.batch-book-list, .batch-slot-list { display: grid; gap: 5px; max-height: 210px; overflow: auto; margin: 0; padding: 0; list-style: none; }
.batch-book-list li { min-width: 0; padding-bottom: 5px; border-bottom: 1px solid #292b27; color: #e1d7c1; font-size: 11px; line-height: 1.4; }
.batch-book-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.batch-book-list small { display: block; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; overflow-wrap: anywhere; }
.batch-slot-list li { display: grid; grid-template-columns: 45px 34px minmax(0, 1fr); gap: 6px; align-items: start; padding-bottom: 5px; border-bottom: 1px solid #292b27; color: #ddd2ba; font-size: 10px; }
.batch-slot-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.batch-slot-list b { color: var(--muted); font-weight: 700; }
.batch-slot-mode.fixed { color: var(--work-highlight); }
.batch-slot-mode.random { color: #9fc7e4; }
.batch-slot-book { min-width: 0; }
.batch-slot-book small { display: block; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; overflow-wrap: anywhere; }
.batch-detail-empty { color: var(--muted); font-size: 11px; }
.review-matrix { margin: 14px 0 16px; padding: 14px; border: 1px solid rgba(229, 192, 101, .24); border-radius: 8px; background: linear-gradient(135deg, rgba(218, 176, 76, .07), rgba(18, 20, 17, .88)); }
.review-matrix-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.review-matrix-head h4 { margin: 2px 0 5px; color: #f2d883; font-size: 15px; }
.review-matrix-head p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.review-matrix-head .review-warning { max-width: 760px; margin-top: 7px; color: #f1ce78; }
.review-kpis { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; min-width: 250px; }
.review-kpis span { display: grid; gap: 2px; min-width: 82px; padding: 8px 9px; border: 1px solid #414033; border-radius: 6px; background: rgba(16, 18, 15, .7); color: var(--muted); font-size: 10px; text-align: center; }
.review-kpis b { color: #f1d37e; font-size: 16px; }
.review-kpis .bad b { color: var(--work-danger); }
.review-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-top: 13px; }
.review-filters label { display: grid; gap: 4px; min-width: 130px; color: var(--muted); font-size: 10px; }
.review-filters label:last-of-type { flex: 1 1 230px; }
.review-filters .field { min-height: 34px; font-size: 12px; }
.review-table-wrap { margin-top: 10px; overflow: auto; max-height: 680px; border: 1px solid #34342d; border-radius: 7px; background: #111310; }
.review-table { width: 100%; min-width: 980px; border-collapse: collapse; font-size: 11px; }
.review-table th { position: sticky; top: 0; z-index: 1; padding: 9px 10px; background: #24241e; color: #d9c99e; text-align: left; font-size: 10px; letter-spacing: .02em; }
.review-table td { vertical-align: top; padding: 9px 10px; border-top: 1px solid #292b27; color: #e0d6c0; line-height: 1.45; }
.review-table td > b, .review-table td small { display: block; }
.review-table td small { margin-top: 3px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; overflow-wrap: anywhere; }
.review-table tbody > tr.review-matrix-row:hover td { background: rgba(229, 192, 101, .045); }
.review-target-list { display: grid; gap: 6px; min-width: 330px; }
.review-target { display: grid; grid-template-columns: minmax(132px, 1fr) auto; column-gap: 8px; row-gap: 3px; padding: 6px 7px; border: 1px solid #35362e; border-radius: 5px; background: rgba(15, 17, 14, .65); }
.review-target > b { color: #e9d6a2; font-size: 10px; }
.review-target > small { grid-column: 1 / -1; margin: 0; }
.review-target > span { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 10px; }
.review-pill { display: inline-flex; align-items: center; max-width: 160px; padding: 2px 5px; border: 1px solid #4a463a; border-radius: 999px; background: #26251f; color: #d3c5a8; font-size: 9px; line-height: 1.3; text-align: left; }
.review-pill.good { border-color: rgba(119, 220, 161, .3); background: rgba(33, 104, 65, .2); color: var(--work-success); }
.review-pill.bad { border-color: rgba(255, 159, 148, .35); background: rgba(102, 37, 34, .26); color: var(--work-danger); }
.review-pill.waiting { border-color: rgba(234, 199, 106, .36); background: #342b18; color: #f1ce78; }
.review-expand { display: block; margin-top: 8px; }
.review-matrix-detail > td { padding: 0; background: rgba(21, 23, 19, .9); }
.review-matrix-detail table { width: 100%; border-collapse: collapse; }
.review-matrix-detail th { position: static; padding: 8px 10px; background: #1d1f1a; color: var(--muted); font-size: 10px; text-align: left; }
.review-matrix-detail td { padding: 8px 10px; border-top: 1px solid #2d2f29; }
.review-platform { display: grid; grid-template-columns: 54px auto; align-items: start; gap: 5px; margin-top: 5px; }
.review-platform:first-child { margin-top: 0; }
.review-platform > b { color: #d9c9a4; font-size: 10px; }
.review-platform > small { grid-column: 1 / -1; margin: 0; }
.review-note-danger { border-color: rgba(255, 159, 148, .35); background: rgba(102, 37, 34, .22); color: #f4c1b9; }
.user-chip { display: inline-flex; align-items: center; min-height: 38px; padding: 7px 10px; color: #e9cd85; border: 1px solid var(--work-border); background: #161814; border-radius: 7px; font-size: 12px; white-space: nowrap; }
.auth-shell { display: grid; min-height: 72vh; place-items: center; padding: 30px 0; }
.auth-card { width: min(430px, 100%); padding: 30px; border: 1px solid rgba(229, 192, 101, .3); background: linear-gradient(145deg, #191a17, #0f1110); box-shadow: var(--shadow); border-radius: 8px; }
.auth-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: linear-gradient(135deg,#f1d57d,#8e6324); color: #1c160b; font-weight: 900; }
.auth-card h1 { margin: 12px 0 8px; font-size: 23px; }
.auth-card p { color: var(--muted); line-height: 1.7; font-size: 13px; }
.auth-card > small { display: block; color: #7f7869; margin-top: 16px; font-size: 11px; line-height: 1.5; }
.auth-form, .member-form { display: grid; gap: 12px; margin-top: 20px; }
.auth-form label, .member-form label { display: grid; gap: 6px; color: #d5c8aa; font-size: 12px; font-weight: 750; }
.auth-form .btn { margin-top: 5px; }
.members-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; }
.member-list { display: grid; gap: 8px; }
.member-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 11px; border: 1px solid #38362e; background: #171916; border-radius: 7px; }
.member-row b { display: block; font-size: 13px; }
.member-row small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.member-controls { display: flex; align-items: center; gap: 8px; }
.member-controls select { min-width: 105px; padding: 7px 8px; font-size: 12px; }
.member-active { color: #cfc2a6; white-space: nowrap; font-size: 12px; }
.loading-state, .service-error { display: grid; min-height: 430px; place-content: center; gap: 10px; color: var(--muted); text-align: center; border: 1px dashed rgba(229, 192, 101, .2); border-radius: 12px; background: rgba(17, 19, 17, .45); }
.loading-state::before { content: ''; width: 24px; height: 24px; justify-self: center; border: 2px solid rgba(232, 195, 107, .2); border-top-color: var(--work-highlight); border-radius: 50%; animation: workbench-spin .85s linear infinite; }
.service-error b { color: #ffc3bb; font-size: 17px; }
.service-error .btn { justify-self: center; margin-top: 6px; }
.work-toast.success { border-color: rgba(139, 224, 174, .45); color: #d2f7e0; }
.work-toast.danger { border-color: rgba(255, 159, 148, .5); color: #ffd0ca; }

@media (max-width: 850px) {
  .collab-tabs { position: sticky; top: 74px; z-index: 15; backdrop-filter: blur(14px); }
  .context-bar { grid-template-columns: 1fr 1fr; }
  .context-bar > div { grid-column: 1 / -1; }
  .browse-head { display: grid; }
  .browse-kpis { justify-content: flex-start; }
  .members-grid { grid-template-columns: 1fr; }
  .shared-batch-head, .member-row { flex-direction: column; align-items: stretch; }
  .member-controls { justify-content: space-between; }
  .batch-detail-meta { grid-template-columns: 1fr 1fr; }
  .batch-detail-grid { grid-template-columns: 1fr; }
  .delivery-status-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .collab-mode .shell { padding-left: 12px; padding-right: 12px; }
  .collab-mode .topbar { gap: 8px; }
  .collab-mode .topbar .brand { gap: 8px; }
  .collab-mode .topbar .logo { width: 34px; height: 34px; border-radius: 10px; }
  .collab-mode .topbar .brand small { max-width: 185px; }
  .system-hero { min-height: 92px; padding: 20px; border-radius: 18px; }
  .system-hero h1 { font-size: 23px; }
  .collab-tabs { top: 63px; margin-left: -2px; margin-right: -2px; }
  .collab-tab { min-height: 42px; padding-left: 11px; padding-right: 11px; }
  .context-bar { grid-template-columns: 1fr; }
  .context-bar > div { grid-column: auto; }
  .browse-toolbar { grid-template-columns: 1fr; }
  .delivery-status-head { flex-direction: column; }
  .delivery-status-grid { grid-template-columns: 1fr; }
  .delivery-next { display: grid; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .collab-mode *, .collab-mode *::before, .collab-mode *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}
