/* ===== Engineering on a phone · section cards, changes, templates, change types, assignments ===== */

/* every section runs with the page rather than scrolling inside its own pane */
#tab-engineering .workspace-pane,
#tab-changes .workspace-pane { overflow: visible; padding-right: 0; }

/* the rail sheet belongs to the changes index · the tab's shared bar hides it for every other section */
#tab-engineering > .pathbar .pathbar-rail-btn,
#tab-changes > .pathbar .pathbar-rail-btn { display: none; }
#tab-changes:has(> #eng-changes:not(.hidden)):has(> #eng-change-detail.hidden) > .pathbar .pathbar-rail-btn { display: inline-flex; }


/* ─── Filters · the search takes the line, the narrowing select and Add share the next ─── */
:is(#tab-engineering, #tab-changes) .section-header .filter-row { display: flex; flex-wrap: wrap; gap: 0.5rem; width: 100%; }
:is(#tab-engineering, #tab-changes) .section-header .filter-row input[type="text"] { flex: 1 1 100%; min-height: var(--touch); }
:is(#tab-engineering, #tab-changes) .section-header .filter-row select { flex: 1 1 auto; min-width: 0; min-height: var(--touch); }
:is(#tab-engineering, #tab-changes) .section-header .filter-row .combo { flex: 1 1 100%; }
:is(#tab-engineering, #tab-changes) .section-header .filter-row .btn-primary,
:is(#tab-engineering, #tab-changes) .section-header .filter-row .btn-secondary { min-height: var(--touch); justify-content: center; }
/* the section's one add action sits at the far end of its line */
:is(#tab-engineering, #tab-changes) .section-header .filter-row > .btn-primary:last-child { margin-left: auto; }


/* ─── List tables · card rows (workspace.css), the name on top and its facts wrapped under it ─── */

/* the supporting facts share one small line under the name */
#eng-changes-tbody td:nth-child(4),
#eng-changes-tbody td:nth-child(5),
#eng-changes-tbody td:nth-child(6),
#eng-templates-tbody td:nth-child(2),
#eng-templates-tbody td:nth-child(3),
#eng-change-types-tbody td:nth-child(2),
#eng-change-types-tbody td:nth-child(3),
#eng-change-types-tbody td:nth-child(4),
#params-tbody td:nth-child(n+5):nth-child(-n+10) { order: 4; flex: none; font-size: 0.78rem; color: var(--text-muted); }
#eng-changes-tbody td:nth-child(5)::before,
#eng-changes-tbody td:nth-child(6)::before,
#eng-templates-tbody td:nth-child(3)::before,
#eng-change-types-tbody td:nth-child(3)::before,
#eng-change-types-tbody td:nth-child(4)::before,
#params-tbody td:nth-child(n+6):nth-child(-n+10)::before { color: var(--text-faint); }
#eng-changes-tbody td:nth-child(5)::before,
#eng-changes-tbody td:nth-child(6)::before,
#eng-change-types-tbody td:nth-child(3)::before,
#params-tbody td:nth-child(6)::before,
#params-tbody td:nth-child(7)::before { content: "· "; }
/* a bare count or Yes/No needs its name back once the column header is gone */
#eng-templates-tbody td:nth-child(2)::before { content: "Lists "; }
#eng-templates-tbody td:nth-child(3)::before { content: "· Tasks "; }
#eng-change-types-tbody td:nth-child(4)::before { content: "· Active "; }
#params-tbody td:nth-child(8)::before { content: "· Active "; }
#params-tbody td:nth-child(9)::before { content: "· Tolerance "; }
#params-tbody td:nth-child(10)::before { content: "· PQP "; }
#eng-changes-tbody td.col-date,
#eng-templates-tbody td.col-date,
#eng-change-types-tbody td.col-date { order: 5; flex: none; margin-left: auto; font-size: 0.75rem; color: var(--text-faint); }
/* the stage tables aren't cards, so their row actions get the same thumb size here */
:is(#tab-engineering, #tab-changes) .col-action button { min-width: var(--touch); min-height: var(--touch); }

/* Changes · the number, its kind and the name lead, the stage rides beside them */
#eng-changes-tbody td:nth-child(1),
#eng-changes-tbody td:nth-child(2) { order: 1; flex: none; }
#eng-changes-tbody td:nth-child(3) { order: 2; flex: 1 1 60%; font-weight: 600; }
#eng-changes-tbody td:nth-child(7) { order: 3; flex: none; }
/* Templates and change types · the name leads */
#eng-templates-tbody td:nth-child(1),
#eng-change-types-tbody td:nth-child(1) { order: 1; flex: 1 1 60%; font-weight: 600; }
/* Parameters · label first, its key beside it, the definition's facts under them */
#params-tbody td:nth-child(4) { order: 1; flex: none; font-weight: 600; }
#params-tbody td:nth-child(3) { order: 2; flex: 1 1 40%; font-family: ui-monospace, 'Cascadia Code', monospace; font-size: 0.8rem; color: var(--text-muted); }
#params-tbody td:nth-child(2)::before { content: "#"; }
#params-tbody td:nth-child(2) { order: 3; flex: none; font-size: 0.75rem; color: var(--text-faint); }


/* ─── One change · the document fills the width, its header actions wrap in thumb-sized rows ─── */
#eng-change-detail:not(.hidden) { max-width: none; border-left-width: 3px; }
.eng-hdr { padding: 0.9rem 0.85rem 1rem; }
.eng-hdr-top h2 { flex: 1 1 100%; font-size: 1.1rem; }
.eng-hdr-actions { margin-left: 0; width: 100%; }
.eng-hdr-actions .btn-icon,
.eng-hdr-actions .btn-primary,
.eng-hdr-actions .btn-secondary,
.eng-hdr-actions .checkout-split > button { min-height: var(--touch); }
.eng-hdr-actions .btn-icon { min-width: var(--touch); }
/* Change Details · one field per line, the whole head a thumb target */
.eng-details-head { min-height: var(--touch); padding: 0.6rem 0.85rem; }
.eng-details-body { padding: 0.25rem 0.85rem 1rem; }
.eng-dgrid { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
.eng-dfield input[type="text"],
.eng-dfield input[type="date"],
.eng-dfield input[type="number"],
.eng-dfield select { min-height: var(--touch); }
.eng-dept-checks label { min-height: 2.25rem; }
/* the stage rail keeps its sideways scroll, each stage a narrower tap */
.stepper-nav .stepper-nav-stage { min-width: 8rem; min-height: 3.25rem; }
.eng-stage-body { padding: 0.9rem 0.6rem 1rem; }
#eng-stage-order .subtab { min-height: var(--touch); }
/* the approvals and task tables keep their columns and scroll sideways inside their card */
.eng-stage-body .table-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.eng-stage-body .data-table td:first-child { white-space: normal; min-width: 9rem; }
/* reordering tasks is drag and drop, which a touch screen doesn't do */
#eng-tasks-table .col-drag { display: none; }


/* ─── Templates editor · a list's name and group stack rather than squeezing onto one line ─── */
.tpl-list-head { flex-wrap: wrap; }
.tpl-list-head .tpl-list-group,
.tpl-item-row .tpl-item-department { width: 100%; }
.tpl-item-row { flex-wrap: wrap; }
