.task-layout { display:grid; grid-template-columns:270px minmax(0,1fr); gap:24px; align-items:start; }
.task-index { position:sticky; top:24px; max-height:calc(100vh - 70px); overflow:auto; }
#task-list { display:flex; flex-direction:column; padding:8px; gap:6px; }
.task-card { padding:14px; display:grid; gap:6px; border:1px solid transparent; border-radius:8px; text-decoration:none; color:var(--text,#20354a); overflow-wrap:anywhere; }
.task-card:hover { background:#f5f8fc; }
.task-card[aria-current="true"] { border-color:#91b6c7; background:#edf5f7; }
.task-card small { color:#65778b; line-height:1.5; }
.task-main { min-width:0; }
.task-form { padding:24px; }
.task-form fieldset { border:0; padding:0; margin:0; min-width:0; }
.task-form legend { font-size:18px; font-weight:650; margin-bottom:18px; }
.task-form > fieldset > h3 { margin:24px 0 8px; }
#task-editor > .panel-heading { position:sticky; top:0; z-index:2; background:#fffefa; gap:18px; }
#task-editor > .panel-heading { flex-wrap:wrap; }
#task-editor > .panel-heading h2 { flex:1 1 200px; }
.task-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.task-fields .field { min-width:0; }
.task-full { grid-column:1/-1; }
.task-parameter { border:1px solid #dbe3eb; background:#fafcfd; border-radius:10px; padding:18px; margin:16px 0; }
.task-parameter h3 { margin:0 0 14px; font-size:16px; }
.task-parameter input[type="checkbox"] { width:18px; height:18px; }
.task-actions { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin:20px 0 0; }
.task-context { padding:12px 18px; border-left:4px solid #28778d; background:#edf5f7; display:flex; justify-content:space-between; gap:24px; align-items:center; margin-bottom:14px; overflow-wrap:anywhere; }
.task-check-body,.task-history-body { padding:22px; }
.task-check-body li,.task-history-body li { line-height:1.7; margin-bottom:8px; overflow-wrap:anywhere; }
.task-diffs { list-style:none; padding:0; }
.task-diffs li { border-bottom:1px solid #e3e9ef; padding:12px 0; }
.task-diffs p { margin:6px 0; white-space:pre-wrap; }
.task-history-body select { max-width:100%; }
.task-pi-panel { border:1px dashed #b9a25a; background:#fffcf2; border-radius:10px; padding:18px; margin:16px 0; }
.task-pi-panel h3 { margin:0 0 8px; font-size:16px; }
.task-pi-panel li { line-height:1.7; margin-bottom:8px; overflow-wrap:anywhere; }
.task-pi-issue { color:#8a5a00; margin:2px 0; }
#page-tasks { min-width:0; }
.pc-workspace .task-context { flex:0 0 auto; padding:5px 12px; margin:0 0 6px; font-size:12px; min-height:30px; }

/* The task content scrolls, not the save controls. No fixed-height long form. */
body.task-workspace { min-width:1180px; }
.task-workspace .sidebar { overflow-y:auto; }
.task-workspace main { height:calc(100dvh - 70px); min-height:0; padding:20px 24px 16px; }
.task-workspace .workspace-footer { display:none; }
.task-workspace #page-tasks { display:flex; flex-direction:column; min-height:0; }
.task-workspace #page-tasks > .page-heading { flex:0 0 auto; margin-bottom:12px; }
.task-workspace #task-notice { flex:0 0 auto; max-height:80px; overflow-y:auto; margin-bottom:12px; padding:9px 14px; }
.task-workspace .task-layout { flex:1; min-height:0; align-items:stretch; }
.task-workspace .task-index { position:static; min-height:0; max-height:none; overflow-y:auto; }
.task-workspace .task-main { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
#task-scroll { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; scroll-padding-block:90px 24px; padding-bottom:24px; }
#task-scroll:focus-visible { outline:2px solid #448c9e; outline-offset:-2px; }
#task-actionbar { flex:0 0 auto; border:1px solid var(--line); border-radius:8px; background:var(--surface); padding:12px 16px; margin-top:8px; box-shadow:0 -3px 12px #142d440d; }
#task-actionbar .task-actions { margin:0; gap:8px; }
#task-actionbar #task-edit-state { margin-bottom:8px; }
@media (max-height:700px) {
  .task-workspace main { padding-block:10px; }
  .task-workspace #page-tasks > .page-heading .eyebrow { display:none; }
  .task-workspace #page-tasks > .page-heading { margin-bottom:8px; }
  .task-workspace #task-notice { max-height:60px; margin-bottom:8px; }
  #task-actionbar { padding:8px 12px; }
}
