:root{--bg:#f5f6f8;--surface:#fff;--ink:#18212b;--muted:#66717d;--line:#dfe4ea;--accent:#214f7b;--accent-dark:#173b5e;--danger:#a62d2d;--shadow:0 1px 3px rgba(0,0,0,.08);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);line-height:1.5}a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}.shell{width:min(1180px,calc(100% - 32px));margin:0 auto}
.site-header{background:#12273a;color:#fff;border-bottom:1px solid #0b1d2c}.header-inner{min-height:62px;display:flex;align-items:center;gap:24px;flex-wrap:wrap}.brand{font-weight:800;font-size:1.1rem;color:#fff}.brand:hover{text-decoration:none}.nav{display:flex;gap:18px;flex:1;flex-wrap:wrap}.nav a{color:#dce8f2}.userbox{display:flex;gap:12px;align-items:center;font-size:.9rem}
.test-as-banner{background:#fff3cd;border-bottom:1px solid #e6c96a;color:#604900}.test-as-inner{min-height:52px;display:flex;align-items:center;justify-content:space-between;gap:18px}.test-as-inner>div{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.test-as-inner form{margin:0}.test-as-action{margin-top:8px}.main{padding:32px 0 56px;min-height:calc(100vh - 120px)}.site-footer{padding:18px 0;border-top:1px solid var(--line);color:var(--muted);font-size:.85rem}h1,h2{line-height:1.15;margin-top:0}h1{font-size:2rem;margin-bottom:8px}h2{font-size:1.2rem;margin-bottom:14px}.eyebrow{text-transform:uppercase;letter-spacing:.08em;font-weight:700;font-size:.72rem;color:var(--muted);margin-bottom:6px}.muted,.meta{color:var(--muted)}.small{font-size:.84rem}.meta{font-size:.82rem;margin-top:3px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);padding:22px;margin-bottom:20px}.narrow{max-width:520px;margin:48px auto}.login-card{text-align:center}.login-card h1{font-size:2.4rem}.page-head,.section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}.page-head{margin-bottom:20px}.section-head{align-items:center}.section-head h2{margin-bottom:0}
.button,.link-button{font:inherit}.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid #c7ced6;background:#fff;color:var(--ink);border-radius:7px;padding:9px 14px;cursor:pointer;text-decoration:none}.button:hover{text-decoration:none;background:#f7f8fa}.button.primary{background:var(--accent);border-color:var(--accent);color:#fff}.button.primary:hover{background:var(--accent-dark)}.button.danger{border-color:#d9a5a5;color:var(--danger)}.button.small{padding:5px 9px;font-size:.84rem}.button.full{width:100%}.link-button{background:none;border:0;color:inherit;padding:0;cursor:pointer;text-decoration:underline}.link-button.danger{color:var(--danger)}.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.actions form{margin:0}
.alert{padding:12px 14px;border-radius:7px;background:#fff6d8;border:1px solid #eed68f;margin:0 0 18px}.alert.error{background:#fff0f0;border-color:#e0aaaa;color:#792020}.workspace-description{max-width:760px}.workspace-summary{display:flex;gap:34px;align-items:center;flex-wrap:wrap}.workspace-summary div,.workspace-summary-link{display:flex;gap:7px;align-items:baseline}.workspace-summary strong,.workspace-summary-link strong{font-size:1.45rem}.workspace-summary span,.workspace-summary-link span{color:var(--muted)}.workspace-summary-link{color:var(--ink);padding:3px 6px;border-radius:6px}.workspace-summary-link:hover{background:#f3f5f7;text-decoration:none}.workspace-lanes{display:flex;flex-direction:column;gap:20px}.workspace-lane{margin:0}.workspace-lane-head{align-items:flex-start}.workspace-lane-head p{margin:4px 0 0;max-width:760px}.item-done{opacity:.62}.item-done strong{text-decoration:line-through}.dashboard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.dashboard-grid .card{margin:0}.capture-form,.search-form,.add-row{display:flex;gap:10px}.capture-form input,.search-form input,.add-row input{flex:1}
.decision-list{display:flex;flex-direction:column}.decision-row{display:flex;justify-content:space-between;gap:20px;padding:18px 0;border-top:1px solid var(--line)}.decision-row:first-child{border-top:0}.decision-main{min-width:0;flex:1}.decision-main h3{margin:3px 0 9px;font-size:1rem}.decision-flags{display:flex;gap:7px;flex-wrap:wrap}.decision-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap}.decision-actions form{margin:0}.decision-assignment-form{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.decision-assignment-form select{width:auto;min-width:260px}.item-list{display:flex;flex-direction:column}.item-row{display:flex;justify-content:space-between;gap:16px;padding:13px 0;border-top:1px solid var(--line);color:var(--ink)}.item-row:first-child{border-top:0}.item-row:hover{text-decoration:none;background:#fafbfc}.right{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}.badge,.priority{display:inline-block;border-radius:999px;padding:3px 8px;font-size:.74rem;background:#eef1f4;color:#44515e;white-space:nowrap}.planning-proposed{background:#fff1cc;color:#755300}.planning-confirmed{background:#e6f4e8;color:#315c37}.planning-draft{background:#eef1f4;color:#5b6672}.priority.high{background:#fff1cc;color:#755300}.priority.critical{background:#ffe3e3;color:#8b2020}.priority.low{background:#edf4ed;color:#3f6541}.empty{color:var(--muted);font-style:italic}
input,select,textarea{font:inherit;border:1px solid #bdc6cf;border-radius:7px;padding:9px 10px;background:#fff;color:var(--ink);width:100%}textarea{resize:vertical;min-height:90px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.form-grid label{font-size:.86rem;font-weight:700}.form-grid label input,.form-grid label select,.form-grid label textarea{margin-top:5px;font-weight:400}.form-grid .wide{grid-column:1/-1}.form-grid.compact{grid-template-columns:repeat(4,minmax(0,1fr))}
.prose{white-space:pre-wrap;overflow-wrap:anywhere}.steps{display:flex;flex-direction:column;margin-bottom:16px}.step{display:grid;grid-template-columns:auto 1fr auto;align-items:start;gap:10px;padding:10px 0;border-top:1px solid var(--line)}.step:first-child{border-top:0}.step.done .step-description{text-decoration:line-through;color:var(--muted)}.step.dragging{opacity:.45}.step-toggle-form,.step-move-form{margin:0}.step-checkbox{width:20px;height:20px;margin:1px 0 0;padding:0;cursor:pointer;accent-color:var(--accent)}.step-number{display:inline-grid;place-items:center;min-width:26px;height:26px;border-radius:999px;background:#eef1f4;color:#44515e;font-size:.78rem;font-weight:700}.step-tools{display:flex;align-items:flex-start;gap:5px}.step-move,.step-drag-handle{border:1px solid var(--line);background:#fff;color:var(--muted);border-radius:6px;min-width:30px;height:30px;padding:0 6px;cursor:pointer;font:inherit}.step-move:hover,.step-drag-handle:hover{border-color:#8d9aa7;color:var(--ink)}.step-move:disabled{opacity:.35;cursor:not-allowed}.step-drag-handle{cursor:grab}.step-drag-handle:active{cursor:grabbing}.step-help{margin:-4px 0 10px}.step-save-status{min-height:1.2em;margin-bottom:8px}.async-status{min-height:1.2em;margin:4px 0 8px}.success-text{color:#35633a}.error-text{color:#8b2020}form[aria-busy="true"]{opacity:.72}.procedure-section{border-top:1px solid var(--line);padding:20px 0}.procedure-section:first-of-type{border-top:0}.procedure-section-unsectioned{background:#fafbfc;border:1px dashed #cfd6dd;border-radius:8px;padding:16px;margin:16px 0}.procedure-section-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:8px}.procedure-section-head h3{margin:2px 0 4px;font-size:1.08rem}.section-tools{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.section-tools form{margin:0}.section-edit-form{min-width:360px;display:grid!important;grid-template-columns:1fr;gap:8px}.procedure-add-section{border-top:1px solid var(--line);margin-top:14px;padding-top:20px}.procedure-add-section h3{margin:0 0 12px}.procedure-reference-block{border:1px solid var(--line);border-radius:8px;padding:14px;margin:14px 0 18px;background:#fbfcfd}.procedure-reference-block h3{margin:0 0 10px}.procedure-attachments{margin:8px 0 14px}.attachment-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-bottom:12px}.attachment-card{border:1px solid var(--line);border-radius:8px;padding:10px;background:#fff;min-width:0}.attachment-image-link{display:block}.attachment-image{display:block;width:100%;max-height:280px;object-fit:contain;border-radius:6px;background:#f3f5f7}.attachment-document{display:flex;align-items:center;gap:10px;min-height:72px;padding:10px;border-radius:6px;background:#f3f5f7;text-decoration:none}.attachment-document strong{font-size:.75rem;border:1px solid var(--line);border-radius:4px;padding:5px}.attachment-document span{overflow-wrap:anywhere}.attachment-meta{margin:8px 0}.attachment-upload{margin-top:10px}.attachment-upload summary{cursor:pointer;color:var(--accent);font-weight:600}.attachment-upload form{display:grid;grid-template-columns:minmax(220px,1fr) minmax(220px,1fr) auto;gap:10px;align-items:end;margin-top:10px}.attachment-upload label{display:grid;gap:5px}.step-edit-form select{min-width:220px}.inline-edit summary{cursor:pointer;color:var(--muted);font-size:.8rem}.inline-edit form{margin-top:8px;display:flex;gap:6px}.inline-edit textarea{min-width:280px}.notes{margin-top:18px}.note{border-top:1px solid var(--line);padding:15px 0}.note:first-child{border-top:0}.danger-zone{display:flex;justify-content:flex-end;margin-top:30px}
.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:10px;border-bottom:1px solid var(--line);vertical-align:top}th{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}.inline-form{display:flex;gap:6px;align-items:center;min-width:330px}.wrap-code{white-space:pre-wrap;overflow-wrap:anywhere}code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.8rem}
@media(max-width:760px){.decision-row{flex-direction:column}.decision-actions{justify-content:flex-start}.decision-assignment-form{width:100%}.decision-assignment-form select{width:100%;min-width:0}.test-as-inner{padding:10px 0;align-items:flex-start;flex-direction:column}.shell{width:min(100% - 22px,1180px)}.header-inner{padding:10px 0;gap:10px}.nav{order:3;width:100%;overflow:auto;flex-wrap:nowrap;padding-bottom:5px}.userbox{margin-left:auto}.main{padding-top:20px}.dashboard-grid,.form-grid,.form-grid.compact{grid-template-columns:1fr}.page-head{align-items:flex-start;flex-direction:column}.capture-form,.search-form,.add-row{flex-direction:column}.item-row{align-items:flex-start}.right{justify-content:flex-start}.step{grid-template-columns:auto 1fr}.step-tools{grid-column:2;justify-content:flex-start;flex-wrap:wrap}.procedure-section-head{flex-direction:column}.section-tools{width:100%}.section-edit-form{min-width:0}.attachment-upload form{grid-template-columns:1fr}.inline-edit{grid-column:auto}.inline-edit form{flex-direction:column}.inline-edit textarea{min-width:0}.card{padding:16px}}

/* Async feedback */
.toast-host{position:fixed;top:18px;right:18px;z-index:1200;display:flex;flex-direction:column;gap:8px;pointer-events:none}.toast{max-width:min(420px,calc(100vw - 36px));padding:11px 14px;border-radius:8px;border:1px solid var(--line);background:#fff;box-shadow:0 8px 28px rgba(0,0,0,.18);opacity:0;transform:translateY(-6px);transition:opacity .16s ease,transform .16s ease;pointer-events:auto}.toast.show{opacity:1;transform:translateY(0)}.toast-success{border-color:#a9c8ad;color:#315c37}.toast-error{border-color:#dfa5a5;background:#fff5f5;color:#792020}.async-status,.step-save-status{display:none}

/* Compact procedure attachments */
.attachment-list-compact{display:flex;flex-direction:column;gap:6px;margin:8px 0}.attachment-compact{display:grid;grid-template-columns:46px minmax(0,1fr) auto;gap:10px;align-items:center;border:1px solid var(--line);border-radius:7px;padding:7px 9px;background:#fff}.attachment-preview-button{width:46px;height:46px;border:1px solid var(--line);border-radius:6px;background:#f3f5f7;padding:0;cursor:pointer;overflow:hidden;color:var(--accent);font-weight:700}.attachment-thumb{width:100%;height:100%;object-fit:cover;display:block}.attachment-pdf-thumb{font-size:.72rem}.attachment-compact-info{min-width:0}.attachment-title-button{display:block;width:100%;border:0;background:none;color:var(--accent);font:inherit;text-align:left;padding:0;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.attachment-title-button:hover{text-decoration:underline}.attachment-file-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.attachment-delete-form{margin:0}.step-content{min-width:0}.step-content .procedure-attachments{margin:6px 0 0}.step-content .attachment-upload{margin-top:4px}.step-content .attachment-upload summary{font-size:.82rem;font-weight:500}.procedure-section>.procedure-attachments{margin:6px 0 12px}

/* Attachment preview */
.attachment-preview-dialog{width:min(1000px,92vw);height:min(820px,90vh);padding:0;border:0;border-radius:10px;box-shadow:0 18px 70px rgba(0,0,0,.35);background:#fff}.attachment-preview-dialog::backdrop{background:rgba(10,18,27,.72)}.attachment-preview-shell{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto}.attachment-preview-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:14px 16px;border-bottom:1px solid var(--line)}.attachment-preview-close{border:0;background:none;font-size:1.8rem;line-height:1;cursor:pointer;color:var(--muted)}.attachment-preview-body{min-height:0;display:grid;place-items:center;background:#eef1f4;padding:12px;overflow:auto}.attachment-preview-image{display:block;max-width:100%;max-height:100%;object-fit:contain}.attachment-preview-pdf{width:100%;height:100%;min-height:520px;border:0;background:#fff}.attachment-preview-actions{display:flex;justify-content:flex-end;padding:10px 16px;border-top:1px solid var(--line)}
@media(max-width:760px){.toast-host{top:10px;right:10px}.attachment-compact{grid-template-columns:42px minmax(0,1fr);}.attachment-delete-form{grid-column:2}.attachment-preview-dialog{width:96vw;height:88vh}.attachment-preview-pdf{min-height:420px}}


/* In-app confirmation dialog */
.confirm-dialog{width:min(520px,calc(100vw - 32px));padding:0;border:0;border-radius:12px;box-shadow:0 18px 70px rgba(0,0,0,.35);background:#fff;color:var(--ink)}
.confirm-dialog::backdrop{background:rgba(10,18,27,.62)}
.confirm-dialog-shell{margin:0}
.confirm-dialog-head{padding:20px 22px 0}
.confirm-dialog-head h2{margin:0;font-size:1.25rem}
.confirm-dialog-body{padding:12px 22px 18px}
.confirm-dialog-body p{margin:0;color:var(--muted)}
.confirm-dialog-actions{display:flex;justify-content:flex-end;gap:10px;padding:14px 22px 20px;border-top:1px solid var(--line)}
.confirm-dialog-actions .button.danger{background:#fff;color:var(--danger);border-color:#d9a5a5}
.confirm-dialog-actions .button.danger:hover{background:#fff4f4}
@media(max-width:760px){.confirm-dialog-actions{flex-direction:column-reverse}.confirm-dialog-actions .button{width:100%}}


/* UI/UX professionalism pass — foundational controls and editor hierarchy */
:root{
  --control-height:42px;
  --focus-ring:0 0 0 3px rgba(33,79,123,.18);
  --surface-subtle:#f8fafc;
}

.button{
  min-height:var(--control-height);
  font-weight:650;
  line-height:1.1;
}
.button.small{
  min-height:34px;
  padding:6px 10px;
}
.button.secondary{
  background:#fff;
  border-color:#b8c2cc;
  color:var(--ink);
}
.button.secondary:hover{
  background:#f4f6f8;
  border-color:#9da9b4;
}
.button.danger:hover{
  background:#fff4f4;
  border-color:#c87979;
}
.button:focus-visible,
.link-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible{
  outline:none;
  box-shadow:var(--focus-ring);
}
.button:disabled,
input:disabled,
select:disabled,
textarea:disabled{
  cursor:not-allowed;
  opacity:.55;
}

input,
select{
  min-height:var(--control-height);
}
input,
select,
textarea{
  border-color:#b8c2cc;
  transition:border-color .12s ease,box-shadow .12s ease,background .12s ease;
}
input:hover,
select:hover,
textarea:hover{
  border-color:#98a5b2;
}
input:focus,
select:focus,
textarea:focus{
  border-color:var(--accent);
}

.editor-card{
  padding:0;
  overflow:hidden;
}
.item-editor{
  display:block;
}
.form-section{
  padding:24px;
}
.form-section + .form-section{
  border-top:1px solid var(--line);
}
.form-section-head{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  margin-bottom:18px;
}
.form-section-head h2{
  margin:0 0 5px;
}
.form-section-head p{
  margin:0;
  max-width:720px;
}
.field-help{
  border:1px solid var(--line);
  border-radius:8px;
  padding:10px 12px;
  background:var(--surface-subtle);
  display:flex;
  flex-direction:column;
  gap:2px;
  align-self:end;
  min-height:var(--control-height);
  font-size:.82rem;
  color:var(--muted);
}
.field-help strong{
  color:var(--ink);
  font-size:.8rem;
}
.advanced-panel{
  border-top:1px solid var(--line);
  background:var(--surface-subtle);
}
.advanced-panel>summary{
  cursor:pointer;
  list-style:none;
  padding:17px 24px;
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:center;
  font-weight:700;
}
.advanced-panel>summary::-webkit-details-marker{
  display:none;
}
.advanced-panel>summary::after{
  content:"＋";
  color:var(--muted);
  font-size:1.1rem;
  font-weight:500;
}
.advanced-panel[open]>summary::after{
  content:"−";
}
.advanced-panel[open]>summary{
  border-bottom:1px solid var(--line);
}
.advanced-grid{
  padding:20px 24px 24px;
}
.editor-actions{
  padding:18px 24px 24px;
  border-top:1px solid var(--line);
  background:#fff;
}

@media(max-width:760px){
  .form-section{padding:18px 16px}
  .advanced-panel>summary{padding:15px 16px;align-items:flex-start}
  .advanced-panel>summary .small{display:none}
  .advanced-grid{padding:16px}
  .editor-actions{padding:16px}
}


/* UI/UX pass — category guidance and managed position directory */
.field-caption{
  display:block;
  margin-top:6px;
  color:var(--muted);
  font-size:.78rem;
  font-weight:500;
  line-height:1.45;
}

.section-heading{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  margin-bottom:16px;
}
.section-heading h2{margin:0 0 4px}
.section-heading p{margin:0}
.count-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:30px;
  height:30px;
  padding:0 9px;
  border-radius:999px;
  background:#eef2f6;
  color:var(--muted);
  font-size:.78rem;
  font-weight:700;
}

.directory-card{padding:22px 24px}
.directory-list{
  display:flex;
  flex-direction:column;
  border-top:1px solid var(--line);
}
.directory-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:20px;
  align-items:center;
  padding:18px 0;
  border-bottom:1px solid var(--line);
}
.directory-row:last-child{border-bottom:0}
.directory-row.is-retired{opacity:.78}
.directory-main{min-width:0}
.directory-title-line{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:5px;
}
.directory-title-line h3{
  margin:0;
  font-size:1rem;
}
.directory-meta,
.directory-usage{
  display:flex;
  flex-wrap:wrap;
  gap:6px 14px;
  align-items:center;
}
.directory-usage{margin-top:6px}
.directory-actions{
  display:flex;
  align-items:center;
  gap:8px;
}
.directory-actions form{margin:0}
.status-pill{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:3px 8px;
  border-radius:999px;
  background:#eef2f6;
  color:#586674;
  font-size:.7rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.status-pill.success{
  background:#e8f5ec;
  color:#2e6840;
}

.compact-editor{max-width:880px}
.position-usage-summary{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin-top:4px;
}
.position-usage-summary>div{
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--surface-subtle);
  padding:12px 14px;
  display:flex;
  flex-direction:column;
  gap:3px;
}
.position-usage-summary strong{font-size:1rem}
.embedded-advanced{
  border:1px solid var(--line);
  border-radius:8px;
  overflow:hidden;
}
.field-readonly{
  display:flex;
  flex-direction:column;
  gap:6px;
}

@media(max-width:760px){
  .directory-card{padding:18px 16px}
  .directory-row{
    grid-template-columns:1fr;
    gap:12px;
  }
  .directory-actions{
    justify-content:flex-start;
    flex-wrap:wrap;
  }
  .position-usage-summary{
    grid-template-columns:1fr;
  }
}


/* UI/UX pass — polish controls and item editor proportions */
.button{
  white-space:normal;
  overflow-wrap:anywhere;
  max-width:100%;
  text-align:center;
  flex:0 0 auto;
}

.editor-card{
  max-width:1040px;
}

.item-editor .form-section{
  padding:26px 28px;
}

.item-editor .form-grid{
  gap:18px 20px;
}

.item-editor textarea{
  min-height:150px;
}

.item-editor .form-section-head{
  margin-bottom:16px;
}

.item-editor .form-section-head h2{
  margin:0;
}

.item-editor .field-help{
  padding:11px 13px;
}

.page-head>.actions,
.page-head>.button{
  flex:0 0 auto;
}

@media(max-width:760px){
  .editor-card{max-width:none}
  .item-editor .form-section{padding:18px 16px}
  .item-editor textarea{min-height:130px}
}


/* UI/UX pass — item header and compact workflow */
.item-page-head{
  align-items:flex-start;
}
.item-page-heading{
  min-width:0;
  flex:1;
}
.item-page-heading h1{
  max-width:920px;
}
.item-status-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
  margin-top:12px;
}
.item-status-row .status-pill,
.item-status-row .priority,
.item-status-row .badge{
  text-transform:none;
  letter-spacing:0;
  font-size:.74rem;
  font-weight:700;
}
.item-context-row{
  display:flex;
  flex-wrap:wrap;
  gap:5px 16px;
  margin-top:10px;
  color:var(--muted);
  font-size:.82rem;
}
.item-context-row strong{
  color:#46515d;
  font-weight:650;
}
.item-head-actions{
  padding-top:2px;
}

.workflow-card{
  padding:22px 24px 24px;
}
.workflow-disclosure>summary{
  list-style:none;
}
.workflow-disclosure>summary::-webkit-details-marker{
  display:none;
}
.workflow-summary{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  cursor:pointer;
}
.workflow-summary h2{
  margin:0 0 4px;
}
.workflow-summary p{
  margin:0;
}
.workflow-summary-side{
  display:flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
}
.workflow-toggle-label{
  display:inline-flex;
  align-items:center;
  gap:5px;
  color:var(--accent);
  font-size:.8rem;
  font-weight:700;
  white-space:nowrap;
}
.workflow-toggle-open{
  display:none;
}
.workflow-toggle-caret{
  display:inline-block;
  width:0;
  height:0;
  margin-top:1px;
  border-left:4px solid transparent;
  border-right:4px solid transparent;
  border-top:5px solid currentColor;
  flex:0 0 auto;
  transition:transform .15s ease;
}
.workflow-disclosure[open] .workflow-toggle-closed{
  display:none;
}
.workflow-disclosure[open] .workflow-toggle-open{
  display:inline;
}
.workflow-disclosure[open] .workflow-toggle-caret{
  transform:rotate(180deg);
}
.workflow-disclosure:not([open]){
  padding-top:18px;
  padding-bottom:18px;
}
.workflow-disclosure:not([open]) .workflow-summary h2{
  font-size:1rem;
}
.workflow-disclosure[open] .workflow-summary{
  margin-bottom:18px;
}
.workflow-summary:focus-visible{
  outline:3px solid rgba(31,91,139,.28);
  outline-offset:5px;
  border-radius:4px;
}
.workflow-card-head{
  margin-bottom:18px;
}
.workflow-card-head h2{
  margin:0 0 4px;
}
.workflow-card-head p{
  margin:0;
}
.workflow-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.workflow-panel{
  min-width:0;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--surface-subtle);
  padding:15px;
}
.workflow-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.workflow-panel-head h3{
  margin:0;
  font-size:.94rem;
}
.workflow-empty{
  min-height:42px;
  margin:0;
  color:var(--muted);
  font-size:.82rem;
}
.workflow-list{
  display:flex;
  flex-direction:column;
}
.workflow-link-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  min-width:0;
  padding:10px 0;
  border-top:1px solid var(--line);
}
.workflow-link-row:first-child{
  border-top:0;
  padding-top:0;
}
.workflow-link-row:last-child{
  padding-bottom:0;
}
.workflow-link-row>div:first-child{
  min-width:0;
}
.workflow-link-row strong{
  font-size:.84rem;
  line-height:1.35;
}
.workflow-link-anchor{
  color:var(--ink);
}
.workflow-link-anchor:hover{
  text-decoration:none;
}
.workflow-link-anchor:hover strong{
  color:var(--accent);
}
.workflow-add{
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid var(--line);
}
.workflow-add summary{
  cursor:pointer;
  color:var(--accent);
  font-size:.8rem;
  font-weight:700;
}
.workflow-add form{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:end;
  margin-top:10px;
}
.workflow-add select{
  min-width:0;
}

@media(max-width:960px){
  .workflow-grid{
    grid-template-columns:1fr;
  }
  .workflow-empty{
    min-height:0;
  }
}

@media(max-width:760px){
  .item-status-row{margin-top:10px}
  .workflow-summary{align-items:center}
  .workflow-summary p{display:none}
  .workflow-summary-side>.muted.small{display:none}
  .item-context-row{gap:4px 12px}
  .workflow-card{padding:18px 16px}
  .workflow-add form{grid-template-columns:1fr}
}


/* UI/UX pass — compact application navigation */
.site-header{
  position:relative;
  z-index:100;
}
.header-inner{
  min-height:64px;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:22px;
  flex-wrap:initial;
}
.brand{
  white-space:nowrap;
}
.nav{
  display:flex;
  align-items:center;
  gap:3px;
  min-width:0;
  flex-wrap:nowrap;
}
.nav>a,
.nav-menu>summary{
  display:flex;
  align-items:center;
  min-height:38px;
  padding:8px 10px;
  border-radius:7px;
  color:#dce8f2;
  font-size:.92rem;
  line-height:1.2;
  white-space:nowrap;
  cursor:pointer;
}
.nav>a:hover,
.nav-menu>summary:hover,
.nav .nav-active{
  background:rgba(255,255,255,.10);
  color:#fff;
  text-decoration:none;
}
.nav .nav-active{
  font-weight:700;
}
.nav-menu{
  position:relative;
}
.nav-menu>summary{
  list-style:none;
}
.nav-menu>summary::-webkit-details-marker{
  display:none;
}
.nav-menu>summary::after{
  content:"▾";
  margin-left:6px;
  font-size:.72rem;
  opacity:.72;
}
.nav-menu[open]>summary::after{
  content:"▴";
}
.nav-menu-panel{
  position:absolute;
  top:calc(100% + 7px);
  left:0;
  z-index:110;
  min-width:190px;
  padding:7px;
  border:1px solid #d5dce3;
  border-radius:9px;
  background:#fff;
  box-shadow:0 14px 34px rgba(10,18,27,.18);
}
.nav-menu-panel>a,
.nav-menu-action{
  display:block;
  width:100%;
  padding:9px 10px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--ink);
  font:inherit;
  font-size:.9rem;
  line-height:1.25;
  text-align:left;
  text-decoration:none;
  cursor:pointer;
}
.nav-menu-panel>a:hover,
.nav-menu-action:hover{
  background:#f1f4f7;
  text-decoration:none;
}
.userbox{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  min-width:0;
}
.userbox .nav-menu>summary{
  max-width:230px;
  overflow:hidden;
  text-overflow:ellipsis;
  color:#fff;
}
.account-menu .nav-menu-panel{
  left:auto;
  right:0;
  min-width:235px;
}
.account-menu-label{
  padding:8px 10px 6px;
  color:var(--muted);
  font-size:.78rem;
  overflow-wrap:anywhere;
  border-bottom:1px solid var(--line);
  margin-bottom:4px;
}
.account-menu form{
  margin:0;
}

/* Managed administration lists */
.sr-only{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
.category-create-card{
  padding-top:20px;
  padding-bottom:20px;
}
.category-create-card .section-head{
  margin-bottom:12px;
}
.category-create-card h2{
  margin-bottom:3px;
}
.category-create-card p{
  margin:0;
}
.category-create-form{
  display:grid;
  grid-template-columns:minmax(240px,520px) auto;
  gap:10px;
  align-items:end;
}
.category-create-form label{
  margin:0;
}
.managed-list{
  display:flex;
  flex-direction:column;
  margin-top:14px;
}
.managed-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:14px 0;
  border-top:1px solid var(--line);
}
.managed-row:first-child{
  border-top:0;
}
.managed-main{
  min-width:0;
  flex:1;
}
.managed-name-form{
  display:grid;
  grid-template-columns:minmax(220px,460px) auto;
  align-items:center;
  gap:8px;
  max-width:560px;
}
.managed-name-form input{
  height:38px;
}
.managed-meta{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:6px 12px;
  margin-top:7px;
  color:var(--muted);
  font-size:.78rem;
}
.managed-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}
.managed-actions form{
  margin:0;
}

@media(max-width:980px){
  .header-inner{
    grid-template-columns:auto 1fr;
    gap:12px 18px;
    padding:8px 0;
  }
  .nav{
    grid-column:1/-1;
    grid-row:2;
    flex-wrap:wrap;
  }
  .userbox{
    grid-column:2;
    grid-row:1;
  }
}

@media(max-width:760px){
  .header-inner{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px 12px;
    padding:8px 0 10px;
  }
  .nav{
    order:initial;
    grid-column:1/-1;
    width:100%;
    overflow:visible;
    flex-wrap:wrap;
    padding-bottom:0;
  }
  .nav>a,
  .nav-menu>summary{
    min-height:34px;
    padding:7px 8px;
    font-size:.86rem;
  }
  .nav-menu-panel{
    min-width:180px;
  }
  .userbox{
    margin-left:0;
  }
  .userbox .nav-menu>summary{
    max-width:180px;
  }
  .category-create-form,
  .managed-name-form{
    grid-template-columns:1fr;
  }
  .managed-row{
    align-items:flex-start;
    flex-direction:column;
    gap:10px;
  }
  .managed-actions{
    width:100%;
  }
}


/* UI/UX follow-up — compact procedure status chips */
.procedure-list .item-row{
  align-items:center;
}
.procedure-list .item-row>div:first-child{
  min-width:0;
  flex:1;
}
.procedure-state-badge{
  flex:0 0 auto;
  min-width:max-content;
  white-space:nowrap;
  padding:4px 9px;
  line-height:1.15;
  text-align:center;
}


/* UX slice — focused dashboard */
.alert.success{
  background:#eef8f0;
  border-color:#b9d9c0;
  color:#285b34;
}
.alert.success a{
  color:#174c28;
  font-weight:700;
}

.dashboard-head{
  margin-bottom:20px;
}
.dashboard-head p{
  max-width:720px;
}

.dashboard-capture-success{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.dashboard-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin:0 0 18px;
}
.dashboard-stat{
  display:block;
  min-width:0;
  padding:14px 16px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#fff;
  color:var(--ink);
  box-shadow:0 1px 2px rgba(19,36,51,.04);
}
.dashboard-stat:hover{
  border-color:#aab8c4;
  text-decoration:none;
  box-shadow:0 4px 12px rgba(19,36,51,.07);
}
.dashboard-stat.attention{
  border-color:#e7cf93;
  background:#fffdf7;
}
.dashboard-stat-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.dashboard-stat-top span{
  font-weight:700;
  font-size:.86rem;
}
.dashboard-stat-top strong{
  font-size:1.45rem;
  line-height:1;
}
.dashboard-stat small{
  display:block;
  margin-top:7px;
  color:var(--muted);
  font-size:.73rem;
  line-height:1.35;
}

.dashboard-capture{
  display:grid;
  grid-template-columns:minmax(220px,360px) minmax(0,1fr);
  gap:24px;
  align-items:end;
  padding-top:18px;
  padding-bottom:18px;
}
.dashboard-capture h2{
  margin:0 0 4px;
}
.dashboard-capture p{
  margin:0;
  font-size:.88rem;
  line-height:1.45;
}
.dashboard-capture .capture-form{
  margin:0;
}

.dashboard-sections{
  margin-top:20px;
}
.dashboard-card{
  min-width:0;
  padding:20px 22px;
}
.dashboard-section-head{
  align-items:flex-start;
  margin-bottom:8px;
}
.dashboard-section-head h2{
  margin:0 0 3px;
}
.dashboard-section-head p{
  margin:0;
}
.dashboard-section-head>a{
  white-space:nowrap;
  font-size:.84rem;
}

.dashboard-item-list{
  margin-top:6px;
}
.dashboard-item-row{
  align-items:center;
  padding:11px 0;
}
.dashboard-item-row>div:first-child{
  min-width:0;
}
.dashboard-item-row strong{
  display:block;
  font-size:.91rem;
  line-height:1.35;
}
.dashboard-item-row .meta{
  margin-top:3px;
  font-size:.76rem;
}
.dashboard-reason{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  min-height:25px;
  padding:4px 9px;
  border-radius:999px;
  background:#eef1f4;
  color:#4f5d69;
  font-size:.72rem;
  font-weight:700;
  line-height:1.2;
  white-space:nowrap;
}
.dashboard-reason.warning{
  background:#fff1cc;
  color:#755300;
}
.dashboard-reason.danger{
  background:#ffe3e3;
  color:#8b2020;
}
.dashboard-reason.neutral{
  background:#eef1f4;
  color:#4f5d69;
}

.dashboard-empty{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-height:74px;
  justify-content:center;
  padding:10px 0 4px;
  color:var(--muted);
}
.dashboard-empty strong{
  color:#43515d;
  font-size:.9rem;
}
.dashboard-empty span{
  font-size:.8rem;
  line-height:1.4;
}
.dashboard-total{
  margin:16px 0 0;
  text-align:right;
}

@media(max-width:980px){
  .dashboard-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .dashboard-capture{
    grid-template-columns:1fr;
    gap:14px;
    align-items:stretch;
  }
}

@media(max-width:760px){
  .dashboard-summary{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .dashboard-stat{
    padding:12px;
  }
  .dashboard-stat small{
    display:none;
  }
  .dashboard-stat-top{
    align-items:flex-start;
    flex-direction:column-reverse;
    gap:5px;
  }
  .dashboard-stat-top strong{
    font-size:1.3rem;
  }
  .dashboard-capture-success{
    align-items:flex-start;
    flex-direction:column;
  }
  .dashboard-card{
    padding:16px;
  }
  .dashboard-item-row{
    align-items:flex-start;
  }
  .dashboard-reason{
    margin-top:1px;
  }
  .dashboard-total{
    text-align:left;
  }
}


/* UX follow-up — dismissible capture notice and cleaner task checklists */
.dashboard-capture-success-actions{
  display:flex;
  align-items:center;
  gap:14px;
  flex:0 0 auto;
}
.dashboard-capture-dismiss{
  color:#52705a!important;
  font-weight:600!important;
  font-size:.82rem;
}

.checklist-head{
  align-items:flex-start;
  margin-bottom:8px;
}
.checklist-head h2{
  margin:0 0 3px;
}
.checklist-head p{
  margin:0;
}
.checklist-progress{
  min-width:max-content;
  padding:5px 10px;
}

.task-steps-wrap{
  margin-top:4px;
}
.checklist-steps{
  margin:0;
}
.checklist-steps .checklist-step{
  grid-template-columns:30px minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  min-height:54px;
  padding:11px 0;
}
.checklist-steps .step-toggle-form{
  display:flex;
  align-items:center;
  justify-content:center;
  align-self:center;
  width:30px;
  min-height:30px;
}
.checklist-steps .step-checkbox{
  width:21px;
  height:21px;
  margin:0;
  flex:0 0 auto;
}
.checklist-step-label{
  display:block;
  margin:0;
  line-height:1.45;
  cursor:pointer;
  overflow-wrap:anywhere;
}
.checklist-step.done{
  opacity:.7;
}
.checklist-step.done .checklist-step-label{
  text-decoration:line-through;
}

.checklist-step-actions{
  position:relative;
  justify-self:end;
}
.checklist-step-actions>summary{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border:1px solid transparent;
  border-radius:7px;
  color:#65727f;
  cursor:pointer;
  list-style:none;
  font-weight:700;
  letter-spacing:1px;
  line-height:1;
}
.checklist-step-actions>summary::-webkit-details-marker{
  display:none;
}
.checklist-step-actions>summary:hover,
.checklist-step-actions[open]>summary{
  border-color:var(--line);
  background:#f5f7f9;
  color:var(--ink);
}
.checklist-step-actions-panel{
  position:absolute;
  top:calc(100% + 5px);
  right:0;
  z-index:40;
  width:220px;
  padding:7px;
  border:1px solid #d5dce3;
  border-radius:9px;
  background:#fff;
  box-shadow:0 12px 28px rgba(10,18,27,.16);
}
.checklist-step-actions-panel form{
  margin:0;
}
.checklist-menu-action,
.checklist-inline-edit>summary{
  display:block;
  width:100%;
  padding:9px 10px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--ink);
  font:inherit;
  font-size:.84rem;
  line-height:1.25;
  text-align:left;
  cursor:pointer;
}
.checklist-menu-action:hover,
.checklist-inline-edit>summary:hover{
  background:#f1f4f7;
}
.checklist-menu-action:disabled{
  color:#a7b0b8;
  cursor:not-allowed;
  background:transparent;
}
.checklist-menu-action.danger{
  color:#a42d25;
}
.checklist-inline-edit{
  margin:0;
}
.checklist-inline-edit>summary{
  list-style:none;
}
.checklist-inline-edit>summary::-webkit-details-marker{
  display:none;
}
.checklist-inline-edit[open]{
  margin:3px 0;
  padding:7px;
  border-radius:7px;
  background:#f7f9fa;
}
.checklist-inline-edit[open]>summary{
  padding:3px 3px 8px;
  background:transparent;
  font-weight:700;
}
.checklist-inline-edit .step-edit-form{
  display:grid!important;
  grid-template-columns:1fr;
  gap:8px;
  width:100%;
  margin:0;
}
.checklist-inline-edit .step-edit-form input{
  width:100%;
  min-width:0;
}
.checklist-inline-edit .step-edit-form .button{
  justify-self:start;
}

.checklist-add{
  margin-top:8px;
  padding-top:14px;
  border-top:1px solid var(--line);
}
.checklist-add-row{
  margin:0;
}
.checklist-add-row input{
  min-height:42px;
}

@media(max-width:760px){
  .dashboard-capture-success-actions{
    width:100%;
    justify-content:space-between;
  }
  .checklist-steps .checklist-step{
    grid-template-columns:30px minmax(0,1fr) auto;
    gap:9px;
  }
  .checklist-step-actions-panel{
    width:min(260px,calc(100vw - 50px));
  }
  .checklist-add-row{
    flex-direction:column;
  }
  .checklist-add-row .button{
    align-self:flex-start;
  }
}


/* UX follow-up — shared compact step action menus */
.procedure-steps .step{
  grid-template-columns:30px minmax(0,1fr) auto;
  align-items:start;
  gap:12px;
  min-height:58px;
  padding:12px 0;
}
.procedure-steps .step-number{
  width:28px;
  min-width:28px;
  height:28px;
  margin-top:1px;
}
.procedure-steps .step-description{
  display:block;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.step-actions-menu{
  position:relative;
  justify-self:end;
}
.step-actions-menu>summary{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border:1px solid transparent;
  border-radius:7px;
  color:#65727f;
  cursor:pointer;
  list-style:none;
  font-weight:700;
  letter-spacing:1px;
  line-height:1;
}
.step-actions-menu>summary::-webkit-details-marker{
  display:none;
}
.step-actions-menu>summary:hover,
.step-actions-menu[open]>summary{
  border-color:var(--line);
  background:#f5f7f9;
  color:var(--ink);
}
.step-actions-panel{
  position:absolute;
  top:calc(100% + 5px);
  right:0;
  z-index:45;
  width:230px;
  padding:7px;
  border:1px solid #d5dce3;
  border-radius:9px;
  background:#fff;
  box-shadow:0 12px 28px rgba(10,18,27,.16);
}
.step-actions-panel form{
  margin:0;
}
.step-menu-action,
.step-inline-edit>summary{
  display:block;
  width:100%;
  padding:9px 10px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--ink);
  font:inherit;
  font-size:.84rem;
  line-height:1.25;
  text-align:left;
  cursor:pointer;
}
.step-menu-action:hover,
.step-inline-edit>summary:hover{
  background:#f1f4f7;
}
.step-menu-action:disabled{
  color:#a7b0b8;
  cursor:not-allowed;
  background:transparent;
}
.step-menu-action.danger{
  color:#a42d25;
}
.step-inline-edit{
  margin:0;
}
.step-inline-edit>summary{
  list-style:none;
}
.step-inline-edit>summary::-webkit-details-marker{
  display:none;
}
.step-inline-edit[open]{
  margin:3px 0;
  padding:7px;
  border-radius:7px;
  background:#f7f9fa;
}
.step-inline-edit[open]>summary{
  padding:3px 3px 8px;
  background:transparent;
  font-weight:700;
}
.step-inline-edit .step-edit-form{
  display:grid!important;
  grid-template-columns:1fr;
  gap:8px;
  width:100%;
  margin:0;
}
.step-inline-edit .step-edit-form input,
.step-inline-edit .step-edit-form select{
  width:100%;
  min-width:0;
}
.step-inline-edit .step-edit-form .button{
  justify-self:start;
}
.procedure-step-actions{
  margin-top:0;
}

@media(max-width:760px){
  .procedure-steps .step{
    grid-template-columns:30px minmax(0,1fr) auto;
    gap:9px;
  }
  .step-actions-panel{
    width:min(270px,calc(100vw - 50px));
  }
}


/* Procedure authoring — clipboard screenshots and drag/drop attachments */
.attachment-upload{
  margin-top:8px;
}
.attachment-upload>summary{
  display:inline-flex;
  align-items:center;
  min-height:34px;
  color:var(--accent);
  font-size:.84rem;
  font-weight:700;
  cursor:pointer;
}
.attachment-upload>summary:hover{
  text-decoration:underline;
}
.attachment-upload>form{
  display:block;
  width:100%;
  margin-top:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#fff;
}
.attachment-paste-target{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-height:92px;
  padding:16px;
  border:2px dashed #b9c5d0;
  border-radius:9px;
  background:#f8fafb;
  outline:none;
  cursor:default;
  transition:border-color .12s ease,background .12s ease,box-shadow .12s ease;
}
.attachment-paste-target strong{
  color:var(--ink);
  font-size:.9rem;
}
.attachment-paste-target>span:not(.attachment-paste-status){
  max-width:720px;
  color:var(--muted);
  font-size:.8rem;
  line-height:1.4;
}
.attachment-paste-target:focus{
  border-color:#5d86ab;
  box-shadow:0 0 0 3px rgba(33,79,123,.12);
  background:#fbfdff;
}
.attachment-paste-target.drag-over{
  border-color:var(--accent);
  background:#eef5fb;
}
.attachment-paste-status{
  display:block;
  min-height:1.2em;
  margin-top:3px;
}
.error-text{
  color:var(--danger)!important;
}
.attachment-upload-fields{
  display:grid;
  grid-template-columns:minmax(220px,1fr) minmax(260px,1.35fr);
  gap:12px;
  margin-top:12px;
}
.attachment-upload-fields label{
  font-size:.8rem;
  font-weight:700;
}
.attachment-upload-fields input{
  margin-top:4px;
  font-weight:400;
}
.attachment-upload-actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-top:12px;
}

@media(max-width:760px){
  .attachment-upload-fields{
    grid-template-columns:1fr;
  }
  .attachment-paste-target{
    min-height:104px;
  }
}


/* Guided template editor */
.template-page-head{
  margin-bottom:18px;
}
.template-intro{
  max-width:860px;
}
.template-form{
  display:flex;
  flex-direction:column;
  gap:18px;
}
.template-form .card{
  margin:0;
}
.template-section{
  padding:24px;
}
.template-section-head{
  display:grid;
  grid-template-columns:34px minmax(0,1fr);
  gap:12px;
  align-items:start;
  margin-bottom:20px;
}
.template-section-head h2{
  margin:0 0 4px;
  font-size:1.2rem;
}
.template-section-head p{
  margin:0;
}
.template-section-number{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border-radius:999px;
  background:#e9f0f6;
  color:var(--accent-dark);
  font-size:.8rem;
  font-weight:800;
}
.template-form .form-grid{
  gap:18px 20px;
}
.template-form label{
  display:block;
}
.field-help{
  display:block;
  margin:3px 0 6px;
  color:var(--muted);
  font-size:.78rem;
  font-weight:400;
  line-height:1.4;
}
.field-help code{
  font-size:.76rem;
}
.template-subhead{
  margin-bottom:10px;
}
.template-subhead h3{
  margin:0 0 3px;
  font-size:1rem;
}
.template-subhead p{
  margin:0;
  font-size:.84rem;
}
.template-procedures-block{
  margin-top:22px;
  padding-top:20px;
  border-top:1px solid var(--line);
}
.template-procedure-options{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.template-procedure-option{
  display:grid!important;
  grid-template-columns:22px minmax(0,1fr);
  gap:10px;
  align-items:start;
  padding:12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fbfcfd;
  cursor:pointer;
}
.template-procedure-option:hover{
  border-color:#b8c4cf;
  background:#f7f9fb;
}
.template-procedure-option input{
  width:18px;
  height:18px;
  margin:2px 0 0;
  padding:0;
  accent-color:var(--accent);
}
.template-procedure-option strong{
  display:block;
  font-size:.9rem;
  line-height:1.35;
}
.template-procedure-meta{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:.76rem;
  font-weight:400;
}
.template-advanced{
  padding:0;
  overflow:hidden;
}
.template-advanced>summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:18px 22px;
  cursor:pointer;
  list-style:none;
}
.template-advanced>summary::-webkit-details-marker{
  display:none;
}
.template-advanced>summary>span{
  display:flex;
  align-items:baseline;
  gap:10px;
  flex-wrap:wrap;
}
.template-advanced>summary::after{
  content:'▾';
  color:var(--muted);
  font-size:.9rem;
}
.template-advanced[open]>summary{
  border-bottom:1px solid var(--line);
}
.template-advanced[open]>summary::after{
  transform:rotate(180deg);
}
.template-advanced-grid{
  padding:22px;
}
.template-form-actions{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:2px;
}

@media(max-width:760px){
  .template-section{
    padding:18px;
  }
  .template-procedure-options{
    grid-template-columns:1fr;
  }
  .template-advanced>summary{
    align-items:flex-start;
    padding:16px 18px;
  }
  .template-advanced>summary>span{
    display:grid;
    gap:2px;
  }
  .template-advanced-grid{
    padding:18px;
  }
}


/* Template editor polish — helper text should read as help, not as disabled controls */
.template-form .field-help{
  display:block;
  min-height:0;
  margin:4px 0 7px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--muted);
  font-size:.78rem;
  font-weight:400;
  line-height:1.4;
  align-self:auto;
}
.template-form .field-help strong{
  color:inherit;
  font-size:inherit;
}
.template-form .form-grid{
  row-gap:16px;
}
.template-form textarea{
  min-height:0;
}
.template-form .template-procedures-block{
  margin-top:18px;
  padding-top:18px;
}


/* UX slice — friendly All Items work finder */
.work-finder{
  margin-bottom:18px;
}
.work-finder-head{
  align-items:flex-start;
  margin-bottom:14px;
}
.work-finder-head h2,
.results-head h2{
  margin:0 0 3px;
}
.work-finder-head p,
.results-head p{
  margin:0;
}
.work-finder-form{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  align-items:end;
}
.work-finder-form label{
  margin:0;
  font-size:.78rem;
  font-weight:700;
}
.work-finder-form input,
.work-finder-form select{
  width:100%;
  margin-top:5px;
}
.work-finder-search{
  grid-column:span 2;
}
.work-finder-actions{
  display:flex;
  align-items:end;
}
.work-finder-active{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid var(--line);
  font-size:.8rem;
}
.filter-chip{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:4px 9px;
  border-radius:999px;
  background:#eef2f6;
  color:#44515e;
  font-weight:650;
}
.work-finder-active a{
  margin-left:2px;
}
.results-head{
  margin-bottom:8px;
}
@media(max-width:980px){
  .work-finder-form{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .work-finder-search{
    grid-column:1/-1;
  }
}
@media(max-width:620px){
  .work-finder-form{
    grid-template-columns:1fr;
  }
  .work-finder-search{
    grid-column:auto;
  }
}


/* Recurring template scheduling */
.recurrence-fields [hidden]{
  display:none!important;
}
.field-label{
  display:block;
  font-size:.8rem;
  font-weight:700;
}
.recurrence-weekdays{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.recurrence-day{
  display:inline-flex!important;
  align-items:center;
  gap:7px;
  min-height:40px;
  padding:8px 11px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fbfcfd;
  cursor:pointer;
  font-size:.84rem;
  font-weight:650;
}
.recurrence-day:hover{
  border-color:#b8c4cf;
  background:#f7f9fb;
}
.recurrence-day input{
  width:17px;
  height:17px;
  margin:0;
  padding:0;
  accent-color:var(--accent);
}
.recurrence-inline{
  display:flex;
  align-items:center;
  gap:9px;
}
.recurrence-inline input{
  width:120px;
  flex:0 0 120px;
}
.recurrence-inline span{
  color:var(--muted);
  font-size:.82rem;
}
@media(max-width:620px){
  .recurrence-inline{
    align-items:flex-start;
    flex-direction:column;
    gap:4px;
  }
  .recurrence-inline input{
    width:100%;
    flex:auto;
  }
}


/* Admin user access — readable card/list layout */
.user-access-create-card,
.user-access-directory-card{
  padding:22px 24px;
}
.user-access-create-form{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px 18px;
  align-items:start;
}
.user-access-create-form label,
.user-access-controls label{
  margin:0;
  font-size:.78rem;
  font-weight:700;
}
.user-access-create-form input,
.user-access-create-form select,
.user-access-controls select{
  width:100%;
  margin-top:5px;
}
.user-access-create-actions{
  grid-column:1/-1;
  display:flex;
  justify-content:flex-start;
  margin-top:2px;
}
.user-access-list{
  display:flex;
  flex-direction:column;
  border-top:1px solid var(--line);
}
.user-access-row{
  display:grid;
  grid-template-columns:minmax(190px,240px) minmax(0,1fr) auto;
  gap:18px 22px;
  align-items:center;
  padding:18px 0;
  border-bottom:1px solid var(--line);
}
.user-access-row:last-child{
  border-bottom:0;
}
.user-access-person{
  min-width:0;
}
.user-access-name-line{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:4px;
}
.user-access-name-line h3{
  margin:0;
  font-size:1rem;
}
.user-access-controls{
  display:grid;
  grid-template-columns:repeat(4,minmax(120px,1fr)) auto;
  gap:10px;
  align-items:end;
  min-width:0;
}
.user-access-save{
  display:flex;
  align-items:end;
}
.user-access-actions{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:8px;
  min-width:104px;
}
.user-access-actions form{
  margin:0;
}
.user-access-actions .link-button{
  padding:4px 0;
}

@media(max-width:1100px){
  .user-access-row{
    grid-template-columns:1fr;
    align-items:start;
    gap:12px;
  }
  .user-access-controls{
    grid-template-columns:repeat(4,minmax(0,1fr)) auto;
  }
  .user-access-actions{
    flex-direction:row;
    align-items:center;
    flex-wrap:wrap;
    min-width:0;
  }
}

@media(max-width:760px){
  .user-access-create-card,
  .user-access-directory-card{
    padding:18px 16px;
  }
  .user-access-create-form{
    grid-template-columns:1fr;
  }
  .user-access-create-actions{
    grid-column:auto;
  }
  .user-access-controls{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .user-access-save{
    grid-column:1/-1;
  }
}

@media(max-width:480px){
  .user-access-controls{
    grid-template-columns:1fr;
  }
  .user-access-save{
    grid-column:auto;
  }
}


/* Admin user access — permission cards instead of boolean dropdowns */
.user-access-head{
  margin-bottom:20px;
}
.user-access-directory-card{
  padding:22px 24px;
}
.user-access-directory-head{
  margin-bottom:12px;
}
.user-access-list{
  display:flex;
  flex-direction:column;
  gap:12px;
  border-top:0;
}
.user-access-card{
  display:grid;
  grid-template-columns:minmax(190px,230px) minmax(0,1fr) auto;
  gap:16px 22px;
  align-items:center;
  padding:16px 18px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--surface-subtle);
}
.user-access-person{
  min-width:0;
}
.user-access-name-line{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
  margin-bottom:4px;
}
.user-access-name-line h3{
  margin:0;
  font-size:1rem;
}
.user-access-edit-form{
  display:grid;
  grid-template-columns:minmax(120px,150px) minmax(0,1fr) auto;
  gap:14px;
  align-items:end;
  min-width:0;
}
.user-access-role{
  margin:0;
  font-size:.78rem;
  font-weight:700;
}
.user-access-role select{
  width:100%;
  margin-top:5px;
}
.user-access-permissions{
  display:flex;
  align-items:stretch;
  gap:8px;
  min-width:0;
  margin:0;
  padding:0;
  border:0;
}
.user-access-permissions legend{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
.access-check{
  display:flex;
  align-items:flex-start;
  gap:8px;
  min-width:0;
  flex:1 1 0;
  margin:0;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  cursor:pointer;
}
.access-check:has(input:checked){
  border-color:#9ebbd2;
  background:#f3f8fc;
}
.access-check input{
  width:17px;
  height:17px;
  margin:1px 0 0;
  flex:0 0 auto;
}
.access-check span{
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:1px;
}
.access-check strong{
  font-size:.78rem;
  line-height:1.25;
}
.access-check small{
  color:var(--muted);
  font-size:.68rem;
  line-height:1.25;
}
.user-access-save{
  display:flex;
  align-items:flex-end;
}
.user-access-actions{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:7px;
  min-width:102px;
}
.user-access-actions form{
  margin:0;
}
.user-access-actions .link-button{
  padding:3px 0;
}

.user-access-add-panel{
  margin-top:18px;
  padding:0;
  overflow:hidden;
}
.user-access-add-panel>summary{
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:18px 22px;
  cursor:pointer;
}
.user-access-add-panel>summary::-webkit-details-marker{
  display:none;
}
.user-access-add-panel>summary>span:first-child{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.user-access-add-caret{
  width:0;
  height:0;
  border-left:5px solid transparent;
  border-right:5px solid transparent;
  border-top:6px solid var(--accent);
  transition:transform .15s ease;
}
.user-access-add-panel[open] .user-access-add-caret{
  transform:rotate(180deg);
}
.user-access-add-panel[open]>summary{
  border-bottom:1px solid var(--line);
}
.user-access-create-form{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px 18px;
  align-items:start;
  padding:20px 22px 22px;
}
.user-access-create-form>label{
  margin:0;
}
.user-access-create-form>label>.muted{
  display:block;
  margin-top:4px;
  font-size:.72rem;
  font-weight:400;
  line-height:1.4;
}
.user-access-create-form>label input,
.user-access-create-form>label select{
  width:100%;
  margin-top:5px;
}
.user-access-permissions-create{
  grid-column:1/-1;
}
.user-access-create-actions{
  grid-column:1/-1;
  display:flex;
  justify-content:flex-start;
}

@media(max-width:1180px){
  .user-access-card{
    grid-template-columns:1fr;
    align-items:start;
  }
  .user-access-edit-form{
    grid-template-columns:minmax(120px,150px) minmax(0,1fr) auto;
  }
  .user-access-actions{
    flex-direction:row;
    align-items:center;
    flex-wrap:wrap;
    min-width:0;
  }
}

@media(max-width:820px){
  .user-access-edit-form{
    grid-template-columns:1fr;
  }
  .user-access-permissions{
    flex-direction:column;
  }
  .user-access-save{
    justify-content:flex-start;
  }
  .user-access-create-form{
    grid-template-columns:1fr;
  }
  .user-access-permissions-create,
  .user-access-create-actions{
    grid-column:auto;
  }
}

@media(max-width:560px){
  .user-access-directory-card{
    padding:18px 14px;
  }
  .user-access-card{
    padding:14px;
  }
  .user-access-add-panel>summary{
    padding:16px;
  }
  .user-access-create-form{
    padding:16px;
  }
}


/* Final accessibility pass — keyboard navigation and motion */
.skip-link{
  position:fixed;
  top:8px;
  left:8px;
  z-index:2000;
  transform:translateY(-160%);
  padding:9px 12px;
  border-radius:7px;
  background:#fff;
  color:var(--ink);
  box-shadow:0 4px 16px rgba(10,18,27,.22);
  font-weight:700;
  text-decoration:none;
}
.skip-link:focus{
  transform:translateY(0);
}
.main:focus{
  outline:none;
}
a:not(.button):focus-visible,
.nav-menu-action:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:3px;
}
.site-header a:focus-visible,
.site-header summary:focus-visible,
.nav-menu-action:focus-visible{
  outline:2px solid #fff;
  outline-offset:3px;
}
.site-header .nav-menu-panel a:focus-visible,
.site-header .nav-menu-action:focus-visible{
  outline-color:var(--accent);
}
.nav-menu-panel a[aria-current="page"]{
  background:#eef3f7;
  color:var(--ink);
  font-weight:700;
}
@media(prefers-reduced-motion:reduce){
  *,
  *::before,
  *::after{
    scroll-behavior:auto!important;
    transition-duration:.01ms!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
  }
}

/* Simple coverage work views */
.simple-work-tabs{margin-bottom:18px}
.simple-work-filter,.simple-progress-form{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap;margin-bottom:20px}
.simple-work-filter>label:first-of-type,.simple-progress-form>label{min-width:180px;flex:0 1 300px}
.simple-work-check{display:flex;align-items:center;gap:8px;min-height:42px;margin:0}
.simple-work-check input{width:auto;margin:0}
.simple-work-row,.simple-work-step{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:16px 0;border-bottom:1px solid var(--line)}
.simple-work-row:last-child,.simple-work-step:last-child{border-bottom:0}
.simple-work-row>div:first-child,.simple-work-step>span{min-width:0;flex:1;overflow-wrap:anywhere}
.simple-work-title{font-size:1.05rem;font-weight:650;color:var(--ink)}
.simple-work-row p{margin:6px 0 0}
.simple-work-step form{margin:0;flex:0 0 auto}
.simple-instruction-links{display:flex;gap:10px;flex-wrap:wrap}
.simple-work-context{margin-top:18px}
.simple-work-context .body-text{margin-top:12px}
.simple-work-note{padding:14px 0;border-top:1px solid var(--line);margin-top:14px}
.simple-planning-details p{margin:14px 0 0}
@media(max-width:600px){.simple-work-row{align-items:flex-start;flex-direction:column}.simple-work-filter>label:first-of-type,.simple-progress-form>label{flex-basis:100%}.simple-work-step{align-items:flex-start}}

/* Whole-app reflow: keep content and controls inside their containers. */
input,
select,
textarea,
.form-grid>*{
  min-width:0;
  max-width:100%;
}
.capture-form input,
.search-form input,
.add-row input{
  min-width:0;
}
.page-head>div:first-child,
.section-head>div:first-child,
.section-heading>div:first-child,
.procedure-section-head>div:first-child{
  min-width:0;
}
h1,
h2,
h3,
.meta,
.alert,
.item-context-row,
.directory-meta,
.user-access-person,
.decision-main,
.attachment-preview-head{
  overflow-wrap:anywhere;
}
.item-row>div:first-child{
  min-width:0;
  flex:1;
  overflow-wrap:anywhere;
}
.item-row>.right{
  min-width:0;
  max-width:50%;
}
.badge,
.priority,
.status-pill,
.dashboard-reason,
.filter-chip{
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
}
.template-list-row{
  flex-wrap:wrap;
}
.template-list-row>div:first-child{
  flex:1 1 280px;
}
.template-list-row>.template-list-actions{
  flex:0 1 460px;
  max-width:100%;
  align-items:flex-start;
}
.template-list-actions>.inline-edit{
  flex:1 1 240px;
  min-width:0;
  max-width:100%;
}
.template-list-actions>.inline-edit[open]{
  flex-basis:100%;
}
.template-list-actions .compact-form{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.template-form-actions,
.directory-actions,
.managed-actions,
.dashboard-capture-success-actions{
  flex-wrap:wrap;
}
.table-wrap{
  max-width:100%;
}

@media(max-width:980px){
  .nav{
    position:relative;
  }
  .nav>.nav-menu{
    position:static;
  }
  .nav>.nav-menu>.nav-menu-panel{
    left:0;
    right:auto;
    width:min(320px,100%);
    min-width:0;
  }
}
@media(max-width:760px){
  .header-inner{
    grid-template-columns:auto minmax(0,1fr);
  }
  .userbox .nav-menu,
  .userbox .nav-menu>summary{
    max-width:100%;
  }
  .account-menu .nav-menu-panel{
    min-width:0;
    width:min(280px,calc(100vw - 22px));
  }
  .item-row{
    flex-wrap:wrap;
    gap:8px;
  }
  .item-row>div:first-child{
    flex-basis:100%;
  }
  .item-row>.right{
    max-width:100%;
  }
  .procedure-list .item-row>div:first-child{
    flex-basis:100%;
  }
  .template-list-row>.template-list-actions{
    flex-basis:100%;
    justify-content:flex-start;
  }
  .template-list-actions .compact-form{
    grid-template-columns:1fr;
  }
  .section-head,
  .section-heading,
  .workflow-summary,
  .workflow-summary-side{
    flex-wrap:wrap;
  }
  .managed-main{
    width:100%;
  }
}
