/* Daily SOP workspace. Keep all layout overrides scoped to this route. */
#sopTasks .st-shift-group h4{margin:0;padding:12px;background:var(--st-soft);color:var(--st-green);font-size:14px;display:flex;justify-content:space-between;gap:10px}
#sopTasks .st-shift-group h4 span{font-size:12px;font-weight:400}
#sopTasks .st-assignment-window{font-size:12px;color:var(--st-sub);margin-top:3px}
#sopTasks .st-assignment-warning{font-size:12px;color:var(--st-warn);margin-top:4px}
#sopTasks .st-rule{border:1px solid var(--st-line);border-radius:8px;padding:12px;margin:8px 0;display:grid;gap:10px}
#sopTasks .st-rule legend{font-size:13px;font-weight:600;padding:0 5px}
#sopTasks .st-row-actions{display:flex;flex-direction:column;gap:2px}
#sopTasks #sopAssignNote{min-height:44px;padding:8px;max-width:100%;border:1px solid var(--st-line);border-radius:6px}
.content:has(> #sopTasks){padding:16px 24px 40px}
#sopTasks{--st-bg:#f6f5ef;--st-surface:#fffefa;--st-soft:#edf0e6;--st-ink:#29392f;--st-sub:#52614f;--st-line:#dce2d4;--st-green:#3d5b45;--st-warn:#845019;--st-warn-bg:#f8eee2;--st-red:#a74332;color:var(--st-ink);font-size:15px;line-height:1.5;min-width:0;container:sop / inline-size}
#sopTasks *{box-sizing:border-box;min-width:0}
#sopTasks button,#sopTasks input,#sopTasks textarea,#sopTasks select{font:inherit;touch-action:manipulation}
#sopTasks button{cursor:pointer;color:inherit}
#sopTasks :is(button,input,select,textarea):disabled{opacity:.5;cursor:not-allowed}
#sopTasks :focus-visible{outline:3px solid #799d75;outline-offset:2px}
#sopTasks h2{font-size:22px;line-height:1.3;font-weight:650;letter-spacing:-.4px;margin:0;color:var(--st-ink)}
#sopTasks h3{font-size:15px;line-height:1.5;font-weight:600;margin:0;color:var(--st-ink)}
#sopTasks p{margin:0;overflow-wrap:anywhere}
#sopTasks .st-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:8px;min-height:44px}
#sopTasks .st-heading{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 12px}
#sopTasks .st-date,#sopTasks .st-small{color:var(--st-sub);font-size:12px}
#sopTasks .st-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:44px;min-height:44px;padding:8px 12px;border:1px solid var(--st-line);border-radius:8px;background:var(--st-surface);font-weight:500;line-height:1.4;text-align:center;font-size:14px}
#sopTasks .st-button.primary{background:var(--st-green);border-color:var(--st-green);color:#fffefa}
#sopTasks .st-button.quiet{background:transparent;border-color:transparent;color:var(--st-sub)}
#sopTasks .st-button.danger{color:var(--st-red)}
#sopTasks .st-button:hover:not(:disabled){background:var(--st-soft)}
#sopTasks .st-button.primary:hover:not(:disabled){background:#2d4835}
#sopTasks .st-nav{display:flex;gap:2px;flex-wrap:wrap}
#sopTasks .st-nav .st-button{font-size:13px;padding:8px}
#sopTasks .st-filters{display:flex;gap:6px;padding:4px 0 12px;border-bottom:1px solid var(--st-line);margin-bottom:8px;flex-wrap:wrap}
#sopTasks .st-filters .st-button{border-color:transparent;background:transparent;color:var(--st-sub);padding:8px 12px}
#sopTasks .st-filters [aria-pressed=true]{background:var(--st-green);color:var(--st-surface)}
#sopTasks .st-filters .has-issue:not([aria-pressed=true]){color:var(--st-warn);background:var(--st-warn-bg)}
#sopTasks .st-num{font-size:12px;font-variant-numeric:tabular-nums;line-height:20px;min-width:18px;font-weight:600}
#sopTasks .st-stagebar{display:flex;align-items:center;justify-content:space-between;gap:4px 16px;flex-wrap:wrap;margin-bottom:8px}
#sopTasks .st-stages{display:flex;gap:4px;flex-wrap:wrap}
#sopTasks .st-stages .st-button{border-color:transparent;color:var(--st-sub);background:transparent;padding:8px 12px}
#sopTasks .st-stages [aria-pressed=true]{background:var(--st-soft);color:var(--st-green);font-weight:650}
#sopTasks .st-progress{font-size:12px;color:var(--st-sub)}
#sopTasks .st-workspace{display:grid;grid-template-columns:minmax(0,1fr);align-items:start;gap:20px}
#sopTasks .st-workspace.manager-workspace,#sopTasks .st-workspace.with-panel{grid-template-columns:minmax(0,1.5fr) minmax(320px,1fr)}
#sopTasks .st-list-head{display:flex;align-items:center;gap:10px;min-height:32px;margin-bottom:4px}
#sopTasks .st-list-head h3{font-size:13px;color:var(--st-sub);font-weight:500}
#sopTasks .st-list-head>.st-small{margin-left:auto}
#sopTasks .st-rows{background:var(--st-surface);border:1px solid var(--st-line);border-radius:10px;overflow:clip}
#sopTasks .st-row{display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:8px;padding:7px 12px;border-bottom:1px solid var(--st-line);min-height:80px;scroll-margin-block:calc(var(--hd) + 20px) 100px}
#sopTasks .st-row:last-child{border-bottom:0}
#sopTasks .st-row.issue{background:var(--st-warn-bg)}
#sopTasks .st-row.is-current{background:var(--st-soft);box-shadow:inset 3px 0 var(--st-green)}
#sopTasks .st-row.inactive{opacity:.7}
#sopTasks .st-row-mark{color:var(--st-sub);text-align:center;font-size:20px}
#sopTasks .st-row.issue .st-row-mark{color:var(--st-warn)}
#sopTasks .st-task-name{background:transparent;border:0;padding:0;text-align:left;display:block;min-height:44px;font-size:16px;font-weight:600;line-height:1.5;overflow-wrap:anywhere;width:100%}
#sopTasks .st-task-name:hover{text-decoration:underline;text-underline-offset:4px}
#sopTasks .st-meta{display:flex;flex-wrap:wrap;gap:2px 8px;color:var(--st-sub);font-size:12px;overflow-wrap:anywhere}
#sopTasks .st-status.pending,#sopTasks .st-key{color:var(--st-warn)}
#sopTasks .st-status.approved{color:var(--st-green)}
#sopTasks .st-row-actions{display:flex;gap:2px;align-items:center;justify-content:flex-end;flex-wrap:wrap;max-width:148px}
#sopTasks .st-row-actions .st-button{padding:8px 10px;font-size:13px}
#sopTasks .st-check-hit{min-width:44px;min-height:44px;display:flex;align-items:center;justify-content:center;margin-left:-8px;cursor:pointer}
#sopTasks input[type=checkbox]{width:19px;height:19px;flex:0 0 19px;accent-color:var(--st-green);margin:0}
#sopTasks .st-check-field{display:flex;align-items:center;gap:10px;min-height:44px;margin-bottom:12px;font-size:14px;cursor:pointer}
#sopTasks .st-select-all{display:flex;align-items:center;gap:8px;min-height:44px;font-size:12px;color:var(--st-sub);cursor:pointer}
#sopTasks .st-batch{position:sticky;bottom:12px;z-index:2;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-top:12px;padding:10px 12px;background:var(--st-soft);border:1px solid #aebda9;border-radius:10px;font-size:13px;box-shadow:0 3px 16px #29392f12}
#sopTasks .st-batch select{max-width:100%;min-width:100px;min-height:44px;padding:8px 10px;border:1px solid var(--st-line);border-radius:8px;background:var(--st-surface);color:var(--st-ink);flex:1}
#sopTasks .st-assign-label{font-size:13px;color:var(--st-sub)}
#sopTasks .st-panel{position:sticky;top:calc(var(--hd) + 12px);display:flex;flex-direction:column;max-height:calc(100dvh - var(--hd) - 24px);background:var(--st-surface);border:1px solid var(--st-line);border-radius:10px;overflow:hidden;min-width:0;scroll-margin-top:calc(var(--hd) + 12px)}
#sopTasks .st-panel-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;min-height:60px;padding:8px 16px;border-bottom:1px solid var(--st-line)}
#sopTasks .st-panel-head h3{font-size:14px}
#sopTasks .st-panel-head .st-button{font-size:12px}
#sopTasks .st-panel-scroll{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:16px;scrollbar-width:thin;scrollbar-color:#b7c4ae transparent}
#sopTasks .st-detail-title{font-size:20px;margin-bottom:6px;overflow-wrap:anywhere}
#sopTasks .st-standard{font-size:14px;color:var(--st-sub);margin:16px 0;padding:12px;background:var(--st-bg);border-radius:8px;overflow-wrap:anywhere}
#sopTasks .st-standard>span{display:block;font-size:12px;color:var(--st-sub);margin-bottom:6px}
#sopTasks .st-standard p{white-space:pre-line;color:var(--st-ink);line-height:1.7}
#sopTasks .st-field{display:block;margin-bottom:14px}
#sopTasks .st-field>span{display:block;font-size:13px;margin-bottom:6px;font-weight:500}
#sopTasks .st-field input,#sopTasks .st-field select,#sopTasks .st-field textarea,#sopTasks .st-toolbar input{display:block;width:100%;max-width:100%;min-height:44px;font-size:16px;border:1px solid #bbc7b7;border-radius:8px;background:var(--st-surface);color:var(--st-ink);padding:9px 10px}
#sopTasks textarea{resize:vertical;min-height:88px}
#sopTasks .st-two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
#sopTasks .st-panel-actions{display:flex;flex-wrap:wrap;gap:8px;flex:none;padding:12px 16px;border-top:1px solid var(--st-line);background:var(--st-surface)}
#sopTasks .st-panel-actions .primary{flex:1}
#sopTasks .st-record{padding:12px 0;border-top:1px solid var(--st-line);font-size:14px;overflow-wrap:anywhere}
#sopTasks .st-record span{display:block;color:var(--st-sub);font-size:12px;margin-top:4px}
#sopTasks .st-record p{font-size:13px;color:var(--st-sub);margin-top:6px;white-space:pre-line}
#sopTasks .st-record .st-evidence{color:var(--st-ink);font-size:15px}
#sopTasks .st-record .st-standard{margin:7px 0}
#sopTasks .st-reading strong{display:block;font-size:28px;font-weight:600;font-variant-numeric:tabular-nums;margin-top:4px}
#sopTasks .st-reading small{font-size:16px;font-weight:500}
#sopTasks .st-history{margin-top:16px;border-top:1px solid var(--st-line);padding-top:4px;color:var(--st-sub);font-size:13px}
#sopTasks .st-history summary{min-height:44px;padding:12px 0;cursor:pointer;color:var(--st-green)}
#sopTasks .st-notice{display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:var(--st-soft);color:var(--st-green);padding:10px 12px;border-radius:8px;font-size:13px;margin-bottom:12px;overflow-wrap:anywhere}
#sopTasks .st-notice.warning{background:var(--st-warn-bg);color:var(--st-warn)}
#sopTasks .st-error{font-size:13px;color:var(--st-red);padding:8px 0;overflow-wrap:anywhere}
#sopTasks .st-message{font-size:13px;color:var(--st-green);padding:6px 0 10px}
#sopTasks .st-scope{display:flex;gap:4px;flex-wrap:wrap;padding:3px;background:var(--st-soft);border-radius:10px}
#sopTasks .st-scope .st-button{white-space:normal;border-color:transparent;background:transparent;font-size:13px}
#sopTasks .st-scope [aria-pressed=true]{background:var(--st-surface);color:var(--st-green);border-color:var(--st-line);font-weight:600}
#sopTasks .st-edit-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:8px}
#sopTasks .st-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
#sopTasks .st-toolbar input{width:auto;min-width:0;flex:0 1 180px}
#sopTasks .st-toolbar label{font-size:13px;color:var(--st-sub)}
#sopTasks .st-toolbar.st-controls{margin-bottom:12px}
#sopTasks .st-scope-note{font-size:12px;color:var(--st-sub);margin-bottom:12px}
#sopTasks .st-edit-effective{font-size:12px;color:var(--st-green);padding:8px 0 12px}
#sopTasks .st-order{display:flex;gap:0}
#sopTasks .st-order .st-button{min-width:44px;padding:8px}
#sopTasks .st-empty{padding:32px 16px;background:var(--st-surface);border:1px solid var(--st-line);border-radius:10px;color:var(--st-sub);font-size:13px}
#sopTasks .st-empty strong{display:block;font-weight:600;font-size:16px;color:var(--st-ink);margin-bottom:8px}
#sopTasks .st-panel-placeholder{padding:28px 24px;margin-top:36px;gap:12px;background:transparent;border-style:dashed;font-size:14px;color:var(--st-sub)}
#sopTasks .st-placeholder-mark{font-size:24px;color:var(--st-green)}
#sopTasks .st-completed{margin-top:12px}
#sopTasks .st-completed>summary{min-height:44px;padding:12px 4px;cursor:pointer;font-size:13px;color:var(--st-sub)}
#sopTasks .st-completed>summary span{margin-left:8px}
#sopTasks .st-critical-check{padding:10px;background:var(--st-warn-bg);border-radius:8px;color:var(--st-warn)}
#sopTasks .st-footer{display:flex;gap:8px;align-items:center;justify-content:space-between;flex-wrap:wrap;font-size:12px;color:var(--st-sub);padding-top:12px}
#sopTasks .st-footer>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
#sopTasks .st-footer .st-button{font-size:12px}
#sopTasks .st-row-return{font-size:12px;color:var(--st-warn);margin-top:4px;white-space:pre-line;overflow-wrap:anywhere}
/* A reduced visual viewport gives the task editor the available height. */
.main:has(#sopTasks.st-short-view .has-panel)>.topbar{display:none}
.content:has(#sopTasks.st-short-view .has-panel){padding-top:8px}
#sopTasks.st-short-view .has-panel>.st-head,#sopTasks.st-short-view .has-panel>.st-controls,#sopTasks.st-short-view .has-panel>.st-footer,#sopTasks.st-short-view .with-panel>.st-list{display:none}
#sopTasks.st-short-view .st-workspace.with-panel{grid-template-columns:minmax(0,1fr)}
#sopTasks.st-short-view .st-panel{top:8px}
@container sop (max-width:760px){
  #sopTasks .st-workspace.manager-workspace,#sopTasks .st-workspace.with-panel{grid-template-columns:minmax(0,1fr)}
  #sopTasks .st-panel-placeholder{display:none}
  #sopTasks .has-panel>.st-head,#sopTasks .has-panel>.st-controls,#sopTasks .has-panel>.st-footer,#sopTasks .st-workspace.with-panel>.st-list{display:none}
  #sopTasks .st-panel{width:100%}
  #sopTasks .st-heading{flex-direction:column;gap:2px}
  #sopTasks .st-stagebar{align-items:flex-start}
  #sopTasks .st-edit-tools{align-items:flex-start}
}
@container sop (max-width:440px){
  #sopTasks h2{font-size:20px}
  #sopTasks .st-date{font-size:11px}
  #sopTasks .st-nav .st-button{font-size:12px;padding:8px 6px}
  #sopTasks .st-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
  #sopTasks .st-filters .st-button{font-size:13px;padding:8px 4px}
  #sopTasks .st-stagebar{gap:4px;flex-direction:column}
  #sopTasks .st-stages{width:100%;gap:0;justify-content:space-between}
  #sopTasks .st-stages .st-button{padding:8px;font-size:13px}
  #sopTasks .st-progress{font-size:12px}
  #sopTasks .st-row{grid-template-columns:24px minmax(0,1fr) auto;gap:6px;padding:7px 8px}
  #sopTasks .st-task-name{font-size:15px}
  #sopTasks .st-row-actions{max-width:76px}
  #sopTasks .st-row-actions .st-button{padding:8px 6px;font-size:12px;max-width:76px}
  #sopTasks .st-two{grid-template-columns:minmax(0,1fr);gap:0}
  #sopTasks .st-batch{gap:6px}
  #sopTasks .st-batch>span{flex-basis:100%}
  #sopTasks .st-scope{width:100%}
  #sopTasks .st-scope .st-button{flex:1;padding:8px 6px;font-size:12px}
  #sopTasks .st-order{display:flex;grid-column:2;justify-self:start}
  #sopTasks .st-row:has(.st-order) .st-row-actions{display:contents}
  #sopTasks .st-row:has(.st-order) .st-row-actions>.st-button{grid-column:3;grid-row:1}
  #sopTasks .st-footer>div>span{display:none}
}
@media(max-width:767px){
  .content:has(> #sopTasks){padding:12px 16px calc(100px + env(safe-area-inset-bottom))}
  #sopTasks .st-panel{max-height:calc(100dvh - var(--hd) - 104px - env(safe-area-inset-bottom))}
  #sopTasks .st-batch{bottom:calc(84px + env(safe-area-inset-bottom))}
}
@media(prefers-reduced-motion:no-preference){#sopTasks .st-button{transition:background-color .15s}}

/* WebKit native menulists ignore min-height; keep the new handoff picker touch sized. */
#sopTasks .st-handoff-form select{-webkit-appearance:none;appearance:none;height:44px;padding-right:32px;background-image:linear-gradient(45deg,transparent 50%,var(--st-sub) 50%),linear-gradient(135deg,var(--st-sub) 50%,transparent 50%);background-position:calc(100% - 17px) 50%,calc(100% - 12px) 50%;background-size:5px 5px;background-repeat:no-repeat}
