/* ===========================================================================
   Factory 2 - Tank Farm additions on top of the shared style.css.
   Same palette, same 1px rules; only what the tank farm pages need.
   =========================================================================== */

.tf-summary { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; margin: 18px 0 16px; }
.tf-summary .progbox { flex: 1 1 260px; background: var(--paper); }
.tf-kpi { display: flex; flex-direction: column; justify-content: center; padding: 8px 12px;
  border: 1px solid var(--calc-br); background: var(--calc-bg); color: var(--calc);
  border-radius: var(--radius); min-width: 120px; }
.tf-kpi .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.tf-kpi .v { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tf-kpi.small { border-color: var(--rule); background: var(--paper); color: var(--ink); }
.tf-kpi.small .v { font-size: 14px; }
.tf-kpi.warn { border-color: var(--hold); background: var(--hold-bg); color: var(--hold); }

.tf-filter { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin: 0 0 16px; }
.tf-filter .field { margin: 0; min-width: 180px; }

.tbl.tf { min-width: 1080px; }
.tbl.tf td { vertical-align: middle; }
.tbl.tf tr.tf-zone td { background: var(--ground); text-align: left; font-weight: 600;
  color: var(--navy); font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; padding: 6px 10px; }
.tbl.tf tr.tf-flag td { background: var(--hold-bg); }
.tbl.tf tr.tf-note td { text-align: left; font-size: 12.5px; color: var(--hold); padding: 8px 14px 12px; border-top: 0; background: var(--hold-bg); }
.tbl.tf tr.tf-note td .ico { margin-right: 6px; vertical-align: -2px; }
.tbl.tf td.tf-nodip { text-align: left; font-size: 12.5px; color: var(--steel); }
.tf-adds { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tf-prod { text-align: left !important; }
.tf-prod .qbox { margin-right: 6px; }
.tf-sub { display: block; font-size: 11.5px; color: var(--steel); margin-top: 2px; }
.tf-sub.tf-down { color: var(--stop); }
.tf-sub.tf-up { color: var(--ok); }
.tf-tag { display: inline-block; margin-left: 6px; font-size: 11px; padding: 1px 6px; border: 1px solid var(--busy);
  color: var(--busy); background: var(--busy-bg); border-radius: var(--radius); }
.cell.tf-stuck { border-color: var(--hold); background: var(--hold-bg); color: var(--hold); font-weight: 600; }
.cell.tf-na { border-color: var(--hold); background: var(--hold-bg); color: var(--hold); }
.cell.tf-stock { font-size: 14.5px; }
.tf-mnote { color: var(--hold); }

.tf-tankhead { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 6px 0 22px; }
.tf-entry .field input { font-size: 20px; padding: 10px 12px; font-variant-numeric: tabular-nums; }
.tf-stuckbox { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; }
.tf-live { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0 12px; }
.tf-livecell { border: 1px solid var(--calc-br); background: var(--calc-bg); color: var(--calc);
  border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.tf-livecell .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.tf-livecell .v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tf-livecell .s { font-size: 12.5px; color: var(--steel); font-variant-numeric: tabular-nums; }
.tf-livecell.main .v { font-size: 26px; }

.rjt.tf-pt input.sap { width: 100%; min-width: 92px; text-align: right; }
.tf-steps { padding-left: 22px; margin: 0; }
.tf-steps > li { margin: 0 0 22px; line-height: 1.5; }
.tf-steps > li:last-child { margin-bottom: 4px; }
.tf-steps > li > b { font-size: 14.5px; }
.tf-steps p { margin: 4px 0 6px; color: var(--steel); }
.tf-steps ul { margin: 4px 0 0; padding-left: 18px; }
.tf-steps ul li { margin: 3px 0; }

@media (max-width: 760px) {
  .tf-live { grid-template-columns: minmax(0, 1fr); }
  .tf-summary .tf-kpi.small { display: none; }
}
.tf-wait { display: block; font-size: 12px; color: var(--hold); white-space: nowrap; }

/* login: logo and company name on one line, centred; Factory 2 centred below */
body.signin .masthead { justify-content: center; align-items: center; gap: 10px; margin-bottom: 4px; }
body.signin .masthead strong { font-size: 18px; font-weight: 600; letter-spacing: .4px; color: var(--ink); }
body.signin .masthead .mh-co { font-size: 12px; color: var(--steel); }
body.signin .mh-factory { text-align: center; font-size: 22px; font-weight: 600; color: var(--ink); margin-bottom: 22px; }
@media (max-width: 480px) { body.signin .masthead strong { font-size: 15px; } body.signin .mh-factory { font-size: 19px; } }

/* blending tank: additives as a row of checkboxes */
.tf-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 6px; }
.tf-checks label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

/* oil transfer: one box per tank pair */
.xferbox { border: 1px solid var(--line, #d8dde3); border-radius: 8px; padding: 12px 14px; margin-top: 14px; }
.xferhead { font-size: 15px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.xferhead small { font-weight: 400; opacity: .7; }
#particulars .hint { margin: 0 0 14px; }

/* tank entry: the one tip above the dip fields */
.tf-emptytip { margin: 4px 0 14px; }
.tf-entry .grid.c2 + .tf-emptytip { margin-top: 20px; }
.tf-entry .grid.c2 + .grid.c2 { margin-top: 6px; }
.tf-addfield { margin-top: 4px; }
.tf-addfield .lbl { display: block; margin-bottom: 6px; }

/* Internal Control: the two limits side by side, room between them */
.iclimits { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.iclimit b { font-variant-numeric: tabular-nums; }
/* a fixed limit, shown in a box the same size as the T22 input beside it */
.iclimit-val { display: inline-block; width: 100px; padding: 7px 10px; text-align: center;
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--ground);
  font-weight: 600; font-variant-numeric: tabular-nums; }
.rjt.ic td { padding-top: 12px; padding-bottom: 12px; }

/* Manual */
.tf-pwtip { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); }

/* the tank table fits a normal laptop screen without sideways scrolling */
.tablewrap.tf-wrap { min-width: 1080px; }

/* Variance Reconciliation: sized to fit a laptop screen, the remark gets
   the room left over */
@media (min-width: 861px) {
  .rjt.pt.pt-full.tf-pt { min-width: 1270px; }
  .rjt.tf-pt th:nth-child(1) { width: 96px; }
  .rjt.tf-pt th:nth-child(2), .rjt.tf-pt th:nth-child(3) { width: 108px; }
  .rjt.tf-pt th:nth-child(4), .rjt.tf-pt th:nth-child(7),
  .rjt.tf-pt th:nth-child(8) { width: 104px; }
  .rjt.tf-pt th:nth-child(5), .rjt.tf-pt th:nth-child(6) { width: 92px; }
  .rjt.tf-pt th:nth-child(9) { width: 120px; }
  .rjt.tf-pt th:nth-child(10) { width: 140px; }
  .rjt.tf-pt th:nth-child(12) { width: 72px; }
  .rjt.tf-pt input.sap { min-width: 0; }
}

/* Internal Control: Must Investigate / Investigated / Cleared / All as one
   row of proper buttons, each with its count */
.icseg { display: inline-flex; flex-wrap: wrap; gap: 0; margin-bottom: 16px;
  border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.icseg-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
  font-size: 13.5px; font-weight: 600; color: var(--steel); text-decoration: none;
  border-right: 1px solid var(--rule); }
.icseg-btn:last-child { border-right: 0; }
.icseg-btn:hover { background: var(--ground); color: var(--ink); }
.icseg-n { min-width: 24px; padding: 1px 7px; border-radius: 10px; font-size: 12px; text-align: center;
  background: var(--ground); color: var(--steel); font-variant-numeric: tabular-nums; }
.icseg-btn.on { background: var(--navy); color: #fff; }
.icseg-btn.on .icseg-n { background: rgba(255,255,255,.2); color: #fff; }
.icseg-open.on { background: var(--stop); }
.icseg-open:not(.on) .icseg-n { background: var(--stop-bg, #fdecec); color: var(--stop); }
@media (max-width: 560px) {
  .icseg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .icseg-btn { justify-content: space-between; border-bottom: 1px solid var(--rule); }
}
.tf-addfield + .tf-emptytip { margin-top: 20px; }

/* water tank marked Can't Use: the MT box is greyed out and locked */
.tf-waterfield.off .lbl, .tf-waterfield.off .hint { color: var(--steel); opacity: .6; }
.tf-waterfield.off input { background: var(--ground); color: var(--steel); cursor: not-allowed; }

/* Feed Tank tab */
.ft-seg { flex-wrap: wrap; }
.ft-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(560px, 1fr)); gap: 18px; }
.ft-role h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--navy); }
.ft-role.ft-reject h3 { color: var(--steel); }
.rjt.ft td.d { white-space: nowrap; }
.rjt.ft th { white-space: nowrap; }
.ft-prod { display: inline-block; margin-left: 8px; font-size: 11px; color: var(--steel); }
.ft-shared { display: inline-block; margin-left: 6px; font-size: 11px; padding: 0 6px; border: 1px solid var(--rule);
  border-radius: var(--radius); color: var(--steel); background: var(--ground); cursor: help; }
.ft-state { color: var(--hold); font-size: 12px; }
.rjt.ft .diff { display: inline-block; min-width: 0; }
.ft-remarks { margin: 0; padding-left: 20px; }
.ft-remarks li { margin: 4px 0; }
@media (max-width: 700px) { .ft-grid { grid-template-columns: 1fr; } }
.rjt.ft .ft-opt { text-align: center; width: 120px; }
.ft-sel { width: 110px; padding: 5px 8px; font-weight: 600; }
.ft-badge { display: inline-block; min-width: 76px; padding: 3px 8px; border: 1px solid var(--rule);
  border-radius: var(--radius); font-size: 12px; font-weight: 600; }
.ft-feed { border-color: var(--ok) !important; background: var(--ok-bg); color: var(--ok); }
.ft-dispatch { border-color: var(--hold) !important; background: var(--hold-bg); color: var(--hold); }
.ft-hold { background: var(--ground); color: var(--steel); }
.ft-remark { width: 100%; min-height: 72px; resize: vertical; }
.ft-remark-text { margin: 0; white-space: normal; }
.ft-savebar { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 12px; }
.ft-unsaved { color: var(--hold); font-size: 12.5px; font-weight: 600; }
.repmore { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.repmore .hint { margin: 0; }

/* Feed Tank Simple View: one row per plant */
.fs-row { padding: 16px 0 14px; border-top: 1px solid var(--rule); }
.fs-row:first-of-type { border-top: 0; padding-top: 4px; }
.fs-plant { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 10px; }
.fs-plant a { font-weight: 600; font-size: 15px; color: var(--navy); }
.fs-cmp { font-size: 12px; color: var(--steel); }
.fs-cmp.fs-differ { color: var(--hold); }
.fs-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr); gap: 14px 18px; align-items: start; }
.fs-slot .lbl { display: block; margin-bottom: 6px; }
.fs-fig { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.fs-now { font-weight: 600; }
.fs-fig[hidden] { display: none; }
.fs-ro { display: block; padding: 7px 0; font-weight: 600; }
.fs-set { margin: 8px 0 0; }
.fs-space { display: grid; grid-template-columns: 170px minmax(0, 1fr) 210px; gap: 14px; align-items: center; padding: 6px 0; font-size: 13px; }
.fs-bar { height: 10px; border-radius: 5px; background: var(--ground); overflow: hidden; border: 1px solid var(--rule); }
.fs-bar span { display: block; height: 100%; max-width: 100%; background: var(--navy); }
.fs-free { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .fs-slots { grid-template-columns: 1fr 1fr; }
  .fs-remark { grid-column: 1 / -1; }
  .fs-space { grid-template-columns: 110px minmax(0, 1fr); }
  .fs-free { grid-column: 1 / -1; text-align: left; }
}
.fs-mt { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--steel); }
.fs-mt span { flex: none; min-width: 92px; }
.fs-mt input { width: 100%; padding: 5px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.fs-mt b { color: var(--ink); }
/* plant comparison under the Variance Reconciliation */
.pc-note { margin: 0 0 12px; }
.rjt.pc td { text-align: center; vertical-align: middle; padding: 10px 12px; font-variant-numeric: tabular-nums; }
.rjt.pc td.d { text-align: left; white-space: nowrap; }
.rjt.pc th { padding: 11px 12px; }
.pc-from { margin: 12px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--steel); }

/* Feed Tank plant pages and Master Tank Allocation: one aligned table each,
   a header row per tank group, so every column lines up down the page */
.rjt.ftx { table-layout: fixed; min-width: 900px; }
.rjt.ftx col.ftx-tank { width: 150px; }
.rjt.ftx col.ftx-prod { width: 150px; }
.rjt.ftx col.ftx-opt { width: 140px; }
.rjt.ftx col.ftx-full { width: 170px; }
.rjt.ftx thead th { padding: 11px 14px; text-align: right; }
.rjt.ftx thead th.l { text-align: left; }
.rjt.ftx thead th:last-child { text-align: center; }
.rjt.ftx td { padding: 9px 14px; vertical-align: middle; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rjt.ftx td.l { text-align: left; }
.rjt.ftx td.ftx-o { text-align: center; }
.rjt.ftx td.ftx-o .ft-sel { width: 112px; }
.rjt.ftx tr.ftx-head th { background: var(--ground); color: var(--navy); text-align: left; font-size: 12px;
  font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 14px 14px 8px;
  border-bottom: 1px solid var(--rule); }
.rjt.ftx tbody.ftx-group + tbody.ftx-group tr.ftx-head th { border-top: 10px solid var(--paper); }
.rjt.ftx .ftx-cap { margin-left: 8px; font-weight: 600; color: var(--steel); text-transform: none; letter-spacing: 0; }
.rjt.ftx .ftx-code { font-size: 13.5px; }
.rjt.ftx .ftx-sub { margin-left: 8px; font-size: 11.5px; color: var(--steel); }
.rjt.ftx .ftx-p { color: var(--steel); font-size: 12.5px; }
.rjt.ftx .ftx-chg { font-weight: 600; color: var(--steel); }
.rjt.ftx .ftx-chg.down { color: var(--stop); }
.rjt.ftx .ftx-chg.up { color: var(--ok); }
.rjt.ftx tr.ftx-total td { background: var(--ground); font-weight: 700; border-bottom: 0; }
.rjt.ftx tbody.ftx-reject td, .rjt.ftx tbody.ftx-reject .ftx-code { color: var(--steel); }
.rjt.ftx tbody.ftx-reject tr.ftx-head th { color: var(--steel); }
.ftx-fill { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; width: 100%; }
.ftx-bar { flex: 1; max-width: 90px; height: 8px; border-radius: 4px; background: var(--ground);
  border: 1px solid var(--rule); overflow: hidden; }
.ftx-bar span { display: block; height: 100%; background: var(--navy); }

/* Feed Tank: every tank number in its own box, every product a coloured
   chip by kind of oil, and alternate rows shaded so each tank reads apart */
.rjt.ftx tr.ftx-even td { background: #F6F8FA; }
.rjt.ftx tbody tr:not(.ftx-head):not(.ftx-total):hover td { background: var(--blue-tint); }
.tchip { display: inline-block; min-width: 46px; padding: 3px 8px; text-align: center; font-weight: 700;
  font-size: 13px; color: var(--navy); background: var(--paper); border: 1px solid #9DB3C8;
  border-radius: 3px; font-variant-numeric: tabular-nums; }
.pchip { display: inline-block; padding: 3px 9px; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  border: 1px solid; border-radius: 10px; white-space: nowrap; }
.pchip.pf-crude   { color: #7A4F00; background: #FCF1DC; border-color: #E5C47A; }
.pchip.pf-refined { color: #9C3D12; background: #FDECE4; border-color: #EDB396; }
.pchip.pf-olein   { color: #1E6B3E; background: #E8F3EC; border-color: #9FD0B1; }
.pchip.pf-stearin { color: #0A5A8A; background: #E6F0F7; border-color: #9CC6E2; }
.pchip.pf-acid    { color: #4F3F8C; background: #EFECF7; border-color: #C3B9E3; }
.pchip.pf-other   { color: var(--steel); background: var(--ground); border-color: var(--rule); }
.rjt.ftx tbody.ftx-reject .tchip { color: var(--steel); border-color: var(--rule); }
.ftx-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 10px 0 0; font-size: 12px; color: var(--steel); }

/* Feed Tank tabs in three labelled groups */
.ftnav { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: flex-end; margin-bottom: 14px; }
.ftnav-g { display: flex; flex-direction: column; gap: 6px; }
.ftnav-l { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--steel); }
.ftnav .icseg { margin-bottom: 0; }
.ftnav-ref .icseg-btn, .ftnav-df .icseg-btn { min-width: 52px; justify-content: center; }
.ftnav-ref .ftnav-l { color: #9C3D12; }
.ftnav-ref .icseg { border-color: #EDB396; }
.ftnav-ref .icseg-btn.on { background: #B4501E; }
.ftnav-df .ftnav-l { color: #1E6B3E; }
.ftnav-df .icseg { border-color: #9FD0B1; }
.ftnav-df .icseg-btn.on { background: #1E7A46; }

/* fold a tank group to its header and Total row */
.ftx-bar-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.ftx-bar-top .sec { margin-bottom: 8px; }
.ftx-folds { display: inline-flex; gap: 6px; margin-bottom: 8px; }
.rjt.ftx tbody.is-folded tr:not(.ftx-head):not(.ftx-total) { display: none; }
.rjt.ftx .ftx-fold { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; width: 100%;
  padding: 0; border: 0; background: none; cursor: pointer; text-align: left; font: inherit;
  color: inherit; letter-spacing: inherit; text-transform: inherit; }
.rjt.ftx .ftx-arrow { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid currentColor; transition: transform .15s; }
.rjt.ftx tbody.is-folded .ftx-arrow { transform: rotate(-90deg); }
.rjt.ftx .ftx-count { font-weight: 600; color: var(--steel); text-transform: none; letter-spacing: 0; }
.rjt.ftx .ftx-fold .ft-badge { min-width: 0; padding: 1px 8px; text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.rjt.ftx tr.ftx-head:hover th { background: #E3E8ED; }
/* tighter rows so more tanks fit on the screen */
.rjt.ftx td { padding-top: 6px; padding-bottom: 6px; }
.rjt.ftx td.ftx-o .ft-sel { padding-top: 3px; padding-bottom: 3px; }

/* Simple View: one aligned table, three lines and a remark per plant */
.rjt.fsx col.fsx-plant { width: 190px; }
.rjt.fsx col.fsx-role { width: 120px; }
.rjt.fsx col.fsx-tank { width: 175px; }
.rjt.fsx col.fsx-mt { width: 150px; }
.rjt.ftx-m col.fsx-group { width: 220px; }
.rjt.fsx td.fsx-p { vertical-align: top; padding-top: 12px; background: var(--paper);
  border-right: 1px solid var(--rule); white-space: normal; }
.rjt.fsx .fsx-name { display: block; font-weight: 700; font-size: 14.5px; color: var(--navy); margin-bottom: 6px; }
.rjt.fsx .fsx-cmp, .rjt.fsx .fsx-set { display: block; font-size: 11.5px; color: var(--steel); line-height: 1.5; }
.rjt.fsx .fsx-cmp.fsx-differ { color: var(--hold); font-weight: 600; }
.rjt.fsx td.fsx-role { font-size: 12px; font-weight: 600; color: var(--steel); }
.rjt.fsx select.fs-sel { width: 148px; padding-top: 4px; padding-bottom: 4px; font-weight: 600; }
.rjt.fsx input.fsx-mtin { width: 120px; padding: 4px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.rjt.fsx tr.fsx-remark td { background: #F6F8FA; padding-bottom: 10px; }
.rjt.fsx tr.fsx-remark input { width: 100%; padding: 4px 8px; text-align: left; }
.rjt.fsx tbody.fsx-plantgroup { border-bottom: 3px solid var(--rule); }
.rjt.fsx tbody.fsx-kind tr.ftx-head th { font-size: 12.5px; }
.rjt.fsx tbody.fsx-ref tr.ftx-head th { color: #9C3D12; background: #FDF3EE; }
.rjt.fsx tbody.fsx-df tr.ftx-head th { color: #1E6B3E; background: #EEF7F1; }
.fsx-note { margin: 10px 0 0; }

/* Plant Quality Monitoring */
.pq-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 18px; margin: 6px 0 18px; }
.pq-head .field { margin: 0; }
.pq-head .lbl { display: block; margin-bottom: 6px; }
.pq-fixed { display: block; padding: 7px 10px; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--ground); font-weight: 600; }
.pq-lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.pq-line { border: 1px solid var(--rule); border-radius: 6px; padding: 12px 14px; background: var(--paper); }
.pq-linehead { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--rule); }
.pq-name { font-weight: 700; font-size: 14px; color: var(--navy); min-width: 52px; }
.pq-linehead select { width: 130px; padding: 4px 8px; font-weight: 600; }
.pq-note { font-size: 12px; }
.pq-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px 12px; }
.pq-f { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--steel); }
.pq-f span { min-width: 40px; }
.pq-f input { width: 100%; padding: 5px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.pq-shift + .pq-shift { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule); }
.pq-shifthead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.pq-shifthead h3 { margin: 0; font-size: 15px; }
.pq-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pq-card { border: 1px solid var(--rule); border-radius: 6px; padding: 12px 14px; background: #F6F8FA;
  display: flex; flex-direction: column; gap: 10px; }
.pq-cardhead { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.pq-text { margin: 0; padding: 10px 12px; background: var(--paper); border: 1px solid var(--rule); border-radius: 4px;
  font-family: inherit; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; flex: 1; }
.pq-actions { display: flex; gap: 8px; }
/* each tab group's box runs the full width of its label, buttons shared evenly */
.ftnav-g .icseg { display: flex; width: 100%; }
.ftnav-g .icseg-btn { flex: 1 1 0; justify-content: center; white-space: nowrap; }
.pq-flow { display: flex; align-items: center; gap: 8px; }
.pq-flow .pq-fixed { flex: 1; }
.pq-flow-edit { display: flex; align-items: center; gap: 6px; flex: 1; }
.pq-flow-edit[hidden], .pq-flow .pq-fixed[hidden] { display: none; }
.pq-flow-edit input { width: 100%; padding: 6px 8px; text-align: right; }

/* Plant Overview on a phone: each plant is a card - its name, then for each
   line the tank, product, stock, change and MT stacked, then the remark */
@media (max-width: 760px) {
  .rjt.fsx { min-width: 0; table-layout: auto; }
  .rjt.fsx colgroup, .rjt.fsx thead { display: none; }
  .rjt.fsx, .rjt.fsx tbody, .rjt.fsx tr, .rjt.fsx td, .rjt.fsx th { display: block; width: 100%; }
  .rjt.fsx td { border: 0; padding: 0; text-align: left; white-space: normal; }
  .rjt.fsx tbody.fsx-kind tr.ftx-head th { padding: 12px 12px; border-top: 0; }
  .rjt.fsx tbody.fsx-plantgroup { border: 1px solid var(--rule); border-radius: 8px; margin: 12px 0 16px;
    overflow: hidden; background: var(--paper); }
  .rjt.fsx tr.fsx-slot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px 14px;
    border-bottom: 1px solid var(--rule); background: var(--paper); }
  .rjt.fsx tr.fsx-slot td { background: none; }
  .rjt.fsx td.fsx-p { grid-column: 1 / -1; margin: -12px -14px 4px; padding: 12px 14px; width: auto;
    background: var(--ground); border: 0; border-bottom: 1px solid var(--rule); }
  .rjt.fsx .fsx-name { font-size: 16px; margin-bottom: 2px; }
  .rjt.fsx td.fsx-role { grid-column: 1 / -1; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
  .rjt.fsx td.fsx-tk { grid-column: 1 / -1; }
  .rjt.fsx select.fs-sel, .rjt.fsx input.fsx-mtin, .rjt.fsx tr.fsx-remark input {
    width: 100%; min-height: 44px; font-size: 16px; padding: 8px 10px; }
  .rjt.fsx td.fs-prod { grid-column: 1 / -1; }
  .rjt.fsx td.fs-now, .rjt.fsx td.fs-chg { font-size: 15px; }
  .rjt.fsx td.fs-now::before, .rjt.fsx td.fs-chg::before { content: attr(data-label); display: block;
    font-size: 11.5px; font-weight: 600; color: var(--steel); margin-bottom: 2px; }
  .rjt.fsx td.fsx-mtc { grid-column: 1 / -1; }
  .rjt.fsx tr.fsx-remark { display: grid; gap: 6px; padding: 12px 14px; background: #F6F8FA; }
  .rjt.fsx tr.fsx-remark td { background: none; padding: 0; }
  .fsx-note { font-size: 13px; }
  .ft-savebar .btn { min-height: 46px; flex: 1; font-size: 16px; }
}
@media (max-width: 760px) {
  .rjt.fsx tr.fsx-off td.fs-prod, .rjt.fsx tr.fsx-off td.fs-now, .rjt.fsx tr.fsx-off td.fs-chg,
  .rjt.fsx tr.fsx-off td.fsx-mtc { display: none; }
}

/* Plant Quality Monitoring on a phone: bigger boxes, full-width buttons */
.pq-hint-short { display: none; }
@media (max-width: 760px) {
  .pq-hint-short { display: block; }
  .pq-hint-long { display: none; }
  .pq-head input, .pq-fixed, .pq-linehead select, .pq-f input, .pq-flow-edit input {
    min-height: 44px; font-size: 16px; }
  .pq-linehead select { flex: 1; width: auto; }
  .pq-fields { grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .pq-f { flex-direction: column; align-items: stretch; gap: 4px; }
  .pq-f input { text-align: left; }
  .pq-actions .btn, .pq-shifthead .btn, #pq-form .ft-savebar .btn { flex: 1; min-height: 46px; font-size: 15px; }
  .pq-shifthead .btn { width: 100%; }
  .pq-cards { grid-template-columns: 1fr; }
}
