/* 35-upload-interface.css — /upload-interface (owner: upload-interface; MASTER §6.8).
 * Every rule is scoped under .mp-page-upload-interface (MASTER §4.8).
 * Geometry measured on ASSETS/Screenshot 2026-08-25 at 11.48.00 AM … 2.06.15 PM; colours follow the SPREE
 * Materials Hub UNSW palette (docs/BRAND.md §2, tokens defined in 10-mp-overrides.css). The AG Grid of the
 * original page is approximated with dash_table.DataTable (MASTER §7 C-17): 48 px header, 42 px rows.
 *
 * Contrast (WCAG AA, BRAND §2): yellow is only ever a BACKGROUND (with #181716 text) or a glyph/text colour
 * on the black grid side bar; never yellow text or thin yellow lines on white / light grey. Status colours keep
 * dark text; the outlined danger buttons and the green notes use darker AA variants of the status colours. */

.mp-page-upload-interface {
  /* hub tokens with literal fallbacks (the page also renders standalone in tests) */
  --up-yellow: var(--hub-yellow, #FFDC00);
  --up-yellow-hover: var(--hub-yellow-hover, #F0CF00);
  --up-yellow-tint: var(--hub-yellow-tint-light, #FFFAD9);
  --up-ink: var(--hub-black, #181716);
  --up-link: var(--hub-link, #3F61C4);
  --up-link-hover: var(--hub-link-hover, #2F4A99);
  --up-muted: var(--hub-grey, #737373);
  --up-border: var(--hub-border, #C8C8C8);
  --up-band: var(--hub-band, #EBEBEB);
  --up-bg: var(--hub-bg, #F2F2F2);
  --up-bg-light: var(--hub-bg-light, #F9F9F9);
  --up-hover: var(--hub-blue-tint, #EDF0F9);
  /* AG-like grid */
  --up-ag-border: var(--up-border);
  --up-ag-row: var(--up-band);
  --up-ag-header: var(--up-bg-light);
  --up-ag-odd: #FCFCFC;
  --up-ag-text: var(--up-ink);
  --up-check: var(--up-link);
  /* status (BRAND §2) + AA text variants on white */
  --up-success: var(--hub-success, #48C78E);
  --up-success-text: #257953;
  --up-danger: var(--hub-danger, #F14668);
  --up-danger-text: #CC0F35;
  /* Dash 4 component theme → hub accent (link blue focus, hub borders) */
  --Dash-Fill-Interactive-Strong: var(--up-link);
  --Dash-Stroke-Strong: var(--up-border);
  --tabs-primary: var(--up-ink);
  --tabs-border: var(--up-border);
  --tabs-background: var(--up-bg-light);
  color: var(--up-ink);
}
/* panels are toggled with the hidden attribute; Bulma/flex display rules must not override it */
.mp-page-upload-interface [hidden] { display: none !important; }

/* ------------------------------------------------------------------ tabs: inactive light grey, active yellow + black */
.mp-page-upload-interface .up-tabs-parent { width: 100%; }
.mp-page-upload-interface .up-tabs { display: flex; width: 100%; }
.mp-page-upload-interface .up-tab {
  flex: 1 1 0; min-width: 0; padding: 20px 25px; text-align: center; cursor: pointer;
  background-color: var(--up-bg-light); border: 1px solid var(--up-border); border-bottom: none; color: var(--up-ink);
  font-size: 1rem; line-height: 24px; box-sizing: border-box;
}
.mp-page-upload-interface .up-tab + .up-tab { border-left: none; }
.mp-page-upload-interface .up-tab--selected {
  background-color: var(--up-yellow); color: var(--up-ink); font-weight: 600;
  border-color: var(--up-yellow); border-top: 2px solid var(--up-ink); border-bottom: none;
}
.mp-page-upload-interface .up-tab:hover { background-color: #fff; }
.mp-page-upload-interface .up-tab--selected:hover { background-color: var(--up-yellow); }

/* ------------------------------------------------------------------ dropdowns (react-select look) */
.mp-page-upload-interface .up-dropdown .dash-dropdown,
.mp-page-upload-interface .up-dropdown.dash-dropdown {
  font-size: 1rem;
}
.mp-page-upload-interface .up-project { margin-bottom: 0; }
.mp-page-upload-interface .up-project .dash-dropdown-trigger,
.mp-page-upload-interface .up-project button {
  min-height: 36px;
}

/* ------------------------------------------------------------------ Upload tab: load form */
/* SS 11.48.00 AM (2x): outer box 200 css px tall (border-box), 3 px dashed border in the body text colour
 * (#181716), 9 px dashes / 9 px gaps starting at the corner, radius 5, 10 px margins. Chrome draws a native
 * 3 px `dashed` border as 6 px dashes / 3 px gaps, so the dashes are painted by an SVG stroke (width 6
 * centred on the box edge: the outer half is clipped, 3 px stay visible, the rounded clip of border-radius
 * shapes the corners) over a transparent 3 px dashed border that keeps the box geometry and the computed
 * border style. While a file is dragged over it the box takes the pale yellow tint (black dashes stay). */
.mp-page-upload-interface .up-dropzone {
  display: block; box-sizing: border-box; height: 200px; margin: 10px;
  border: 3px dashed transparent; border-radius: 5px;
  text-align: center; line-height: 60px; color: var(--up-ink); cursor: pointer;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='5' ry='5' fill='none' stroke='%23181716' stroke-width='6' stroke-dasharray='9 9' stroke-dashoffset='5'/%3E%3C/svg%3E");
  background-origin: border-box; background-clip: border-box;
  background-size: 100% 100%; background-repeat: no-repeat;
}
.mp-page-upload-interface .up-dropzone:hover { background-color: var(--up-bg-light); }
.mp-page-upload-interface .up-dropzone.is-active {
  background-color: var(--up-yellow-tint);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='5' ry='5' fill='none' stroke='%23181716' stroke-width='6' stroke-dasharray='9 9' stroke-dashoffset='5'/%3E%3C/svg%3E");
}
.mp-page-upload-interface .up-dropzone-text { font-size: 1rem; }
.mp-page-upload-interface .up-select-link { color: var(--up-link); cursor: pointer; text-decoration: underline; }
.mp-page-upload-interface .up-select-link:hover { color: var(--up-link-hover); }
.mp-page-upload-interface .up-file-name { line-height: 1.5; font-size: .875rem; color: var(--up-muted); }
.mp-page-upload-interface .up-gsheet { margin: 1px 0 0; }
.mp-page-upload-interface .up-gsheet-input {
  height: 38px; border-color: var(--up-border); box-shadow: none; border-radius: 4px; font-size: 1rem;
}
/* G-Sheet instruction text in the AA muted grey (#737373, 4.7:1 on white). Dash 4 puts the className on
 * div.dash-input-container, and the shared rule `div.dash-input-container.input .dash-input-element::placeholder`
 * (specificity 0,3,2) paints a 35 % black (#AEAEAE, 2.3:1); the last selector (0,4,2) outranks it. */
.mp-page-upload-interface .up-gsheet-input::placeholder,
.mp-page-upload-interface .up-gsheet-input input::placeholder,
.mp-page-upload-interface div.dash-input-container.up-gsheet-input .dash-input-element::placeholder { color: var(--up-muted); }
/* disabled while "under maintenance" (MASTER §6.8): same look as SS 11.48.00 AM, not-allowed cursor,
 * bulma-tooltip (data-tooltip on .up-gsheet) carries the maintenance notice on hover (hub black bubble) */
.mp-page-upload-interface .up-gsheet[data-tooltip] { cursor: not-allowed; }
/* one line on desktop, wraps inside the input's width on phones (no horizontal page overflow) */
.mp-page-upload-interface .up-gsheet[data-tooltip]::before {
  font-size: .8rem; white-space: normal; width: max-content; max-width: min(100%, 40rem); text-align: center;
  background: rgba(24, 23, 22, .94); color: #fff;
}
.mp-page-upload-interface .up-gsheet[data-tooltip]::after { border-color: rgba(24, 23, 22, .94) transparent transparent transparent; }
.mp-page-upload-interface .up-gsheet-input,
.mp-page-upload-interface .up-gsheet-input input:disabled,
.mp-page-upload-interface .up-gsheet-input input:disabled::placeholder { cursor: not-allowed; }
.mp-page-upload-interface .up-gsheet-input input:disabled { background-color: transparent; color: var(--up-ink); opacity: 1; }
/* Dash 4 dims disabled inputs (.dash-input-container:has(:disabled) { opacity: .6 }); SS 11.48.00 AM does not */
.mp-page-upload-interface .up-gsheet .dash-input-container.up-gsheet-input { opacity: 1; background-color: #fff; }
.mp-page-upload-interface .up-load-row {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .5rem 0;
  margin-top: 1rem; color: var(--up-ink);
}
.mp-page-upload-interface .up-load-prompt { margin-right: 1.25rem; }
.mp-page-upload-interface .up-mode { display: inline-flex; align-items: center; gap: 1.1rem; }
.mp-page-upload-interface .up-mode label,
.mp-page-upload-interface .up-mode-label { display: inline-flex; align-items: center; gap: .35rem; margin: 0; cursor: pointer; }
.mp-page-upload-interface .up-mode-input,
.mp-page-upload-interface .up-mode input[type="radio"] { margin: 0; accent-color: var(--up-link); }
.mp-page-upload-interface .up-load { margin-left: 2.4rem; }

/* ------------------------------------------------------------------ buttons
 * primary = yellow + black text (shell theme); outlined primary = black outline, yellow fill on hover;
 * outlined danger = red outline with AA red text, red fill + black text on hover; info (Rename) = hub link blue. */
.mp-page-upload-interface .up-btn {
  font-size: .875rem; height: 2.4em; padding: 0 1.15em; border-radius: 2px; letter-spacing: .01em;
}
.mp-page-upload-interface .button.is-primary.up-btn:not(.is-outlined) {
  background-color: var(--up-yellow); border-color: transparent; color: var(--up-ink); font-weight: 600;
}
.mp-page-upload-interface .button.is-primary.up-btn:not(.is-outlined):not([disabled]):hover { background-color: var(--up-yellow-hover); }
.mp-page-upload-interface .button.is-primary.is-outlined.up-btn {
  background: transparent; border-color: var(--up-ink); color: var(--up-ink);
}
.mp-page-upload-interface .button.is-primary.is-outlined.up-btn:hover,
.mp-page-upload-interface .button.is-primary.is-outlined.up-btn:focus {
  background: var(--up-yellow); border-color: var(--up-yellow); color: var(--up-ink);
}
.mp-page-upload-interface .button.is-danger.is-outlined.up-btn {
  background: transparent; border-color: var(--up-danger); color: var(--up-danger-text);
}
.mp-page-upload-interface .button.is-danger.is-outlined.up-btn:not([disabled]):hover {
  background: var(--up-danger); border-color: var(--up-danger); color: var(--up-ink);
}
.mp-page-upload-interface .button.is-danger.up-btn:not(.is-outlined) {
  background-color: var(--up-danger); border-color: transparent; color: var(--up-ink);
}
.mp-page-upload-interface .button.is-danger.is-outlined.up-btn[disabled] { opacity: .55; }
.mp-page-upload-interface .button.is-info.up-btn {
  background-color: var(--up-link); border-color: transparent; color: #fff;
}
.mp-page-upload-interface .button.is-info.up-btn:not([disabled]):hover { background-color: var(--up-link-hover); color: #fff; }
.mp-page-upload-interface .button.up-btn[disabled] { opacity: .55; box-shadow: none; }
.mp-page-upload-interface .up-small-btn {
  height: 1.6rem; padding: 0 .65rem; font-size: .8rem; background: #fff; color: var(--up-ink);
  border: 1px solid var(--up-border); border-radius: 3px; cursor: pointer;
}
.mp-page-upload-interface .up-small-btn:not([disabled]):hover { border-color: var(--up-ink); background: var(--up-yellow); }
.mp-page-upload-interface .up-small-btn-lg { height: 2.85rem; padding: 0 1.2rem; font-size: 1rem; }
.mp-page-upload-interface .up-small-btn[disabled] { cursor: default; }

/* ------------------------------------------------------------------ Upload tab: editor */
.mp-page-upload-interface .up-edit-fields-label {
  margin-top: .95rem; font-size: 1.1rem; font-family: var(--hub-font-heading, Arial, Helvetica, sans-serif);
  font-weight: 600; color: var(--up-ink);
}
.mp-page-upload-interface .up-actions {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .3rem;
}
.mp-page-upload-interface .up-actions-left { display: flex; align-items: center; gap: .2rem; flex-wrap: wrap; }
.mp-page-upload-interface .up-work {
  display: grid; grid-template-columns: minmax(240px, 28.6%) minmax(0, 1fr) minmax(260px, 22.6%);
  align-items: start; margin-top: 1.4rem; min-height: 400px;
}
.mp-page-upload-interface .up-middle { padding: 0 .75rem 0 3rem; min-width: 0; }
.mp-page-upload-interface .up-right { min-width: 0; }

/* AG-like panel (Data Field list, Add Entry table) */
.mp-page-upload-interface .up-ag {
  background: #fff; border: 1px solid var(--up-ag-border); color: var(--up-ag-text); font-size: 14px;
}
.mp-page-upload-interface .up-fields { height: 400px; display: flex; flex-direction: column; overflow: hidden; }
.mp-page-upload-interface .up-ag-header {
  display: flex; align-items: center; height: 48px; flex: 0 0 48px; background: var(--up-ag-header);
  border-bottom: 1px solid var(--up-ag-border); font-weight: 700;
}
.mp-page-upload-interface .up-ag-hcell { padding: 0 17px; display: flex; align-items: center; height: 100%; }
.mp-page-upload-interface .up-fields-name-h { flex: 1 1 auto; position: relative; }
.mp-page-upload-interface .up-fields-name-h::after {
  content: ""; position: absolute; right: 0; top: 50%; height: 30%; transform: translateY(-50%);
  width: 2px; background: var(--up-border);
}
.mp-page-upload-interface .up-fields-inc-h { flex: 0 0 34%; gap: 14px; }
.mp-page-upload-interface .up-ag-body { flex: 1 1 auto; overflow-y: auto; }
.mp-page-upload-interface .up-ag-row {
  display: flex; align-items: stretch; height: 42px; border-bottom: 1px solid var(--up-ag-row); background: #fff;
}
.mp-page-upload-interface .up-ag-row.is-odd { background: var(--up-ag-odd); }
.mp-page-upload-interface .up-ag-row.is-excluded .up-field-name { color: var(--up-muted); }
.mp-page-upload-interface .up-ag-cell { display: flex; align-items: center; }
.mp-page-upload-interface .up-field-name {
  flex: 1 1 auto; min-width: 0; padding: 0 17px 0 45px; border: 1px solid transparent; background: transparent;
  font: inherit; color: inherit; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.mp-page-upload-interface .up-ag-row:hover { background: var(--up-hover); }
/* the field being edited: selected-row yellow tint (shell convention) with a link-blue cell border */
.mp-page-upload-interface .up-ag-row.is-active { background: var(--up-yellow-tint); }
.mp-page-upload-interface .up-ag-row.is-active .up-field-name { border-color: var(--up-link); background: transparent; font-weight: 600; }
.mp-page-upload-interface .up-field-inc { flex: 0 0 34%; padding: 0 17px; }

/* checkbox glyph (AG Grid Alpine shape, hub link blue when checked) */
.mp-page-upload-interface .up-check-btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0;
  background: transparent; cursor: pointer; line-height: 1;
}
.mp-page-upload-interface .up-check-btn[disabled] { cursor: default; }
.mp-page-upload-interface .up-check {
  position: relative; display: inline-block; width: 16px; height: 16px; flex: 0 0 16px;
  border: 1px solid var(--up-muted); border-radius: 3px; background: #fff; box-sizing: border-box;
}
.mp-page-upload-interface .up-check.is-checked,
.mp-page-upload-interface .up-check.is-indeterminate { background: var(--up-check); border-color: var(--up-check); }
.mp-page-upload-interface .up-check.is-checked::after {
  content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.mp-page-upload-interface .up-check.is-indeterminate::after {
  content: ""; position: absolute; left: 3px; right: 3px; top: 6.5px; height: 2px; background: #fff;
}

/* middle panels */
.mp-page-upload-interface .up-panel-title {
  font-size: 1.15rem; font-weight: 600; color: var(--up-ink); margin-bottom: .6rem;
  font-family: var(--hub-font-heading, Arial, Helvetica, sans-serif);
}
.mp-page-upload-interface .up-label { font-size: .95rem; font-weight: 700; color: var(--up-ink); margin: .75rem 0 .35rem; }
.mp-page-upload-interface .up-input { height: 2.25rem; border-color: var(--up-border); box-shadow: none; border-radius: 3px; }
.mp-page-upload-interface .up-af {
  padding: 1.6rem 1.25rem 2rem; border-radius: 8px; border: 1px solid var(--up-border);
  box-shadow: 0 .25em .75em -.125em rgba(24, 23, 22, .08);
}
.mp-page-upload-interface .up-af .up-label:first-of-type { margin-top: 0; }
.mp-page-upload-interface .up-unit-row { display: flex; align-items: center; gap: 2px; margin: .9rem 0; }
.mp-page-upload-interface .up-unit-row[hidden] { display: none; }
.mp-page-upload-interface .up-unit-input {
  width: 130px; height: 1.6rem; padding: 0 .3rem; font-size: .8rem; border: 0; border-bottom: 1px solid var(--up-border);
  background: #fff; color: var(--up-ink);
}
.mp-page-upload-interface .up-unit-input-lg { height: 2.85rem; width: 148px; font-size: .9rem; border: 1px solid var(--up-border); }
.mp-page-upload-interface .up-unit-input[disabled],
.mp-page-upload-interface input.up-unit-input:disabled { background: #fff !important; color: var(--up-ink) !important; opacity: 1; }
.mp-page-upload-interface .up-unit-note { margin-left: .5rem; font-size: .8rem; color: var(--up-success-text); font-weight: 600; }
.mp-page-upload-interface .up-fe { padding: 0 0 1rem; }
.mp-page-upload-interface .up-fe-title { margin-bottom: .35rem; }
.mp-page-upload-interface .up-fe-note { font-size: .95rem; color: var(--up-ink); margin-bottom: .5rem; }
.mp-page-upload-interface .up-fe-rename-row { display: flex; align-items: stretch; }
.mp-page-upload-interface .up-fe-rename-input { flex: 1 1 auto; border-radius: 0; height: 2.85rem; }
.mp-page-upload-interface .up-fe-rename-input[disabled] { background: var(--up-bg); border-color: var(--up-bg); }
.mp-page-upload-interface .up-fe-rename { height: 2.85rem; border-radius: 0; font-size: 1rem; }
.mp-page-upload-interface .up-fe-unit-text { font-size: .95rem; color: var(--up-ink); margin: .75rem 0 .35rem; }
.mp-page-upload-interface .up-fe-unit-row { margin: 0; }
.mp-page-upload-interface .up-ae { height: 400px; display: flex; flex-direction: column; justify-content: space-between; padding-bottom: .9rem; }
.mp-page-upload-interface .up-ae .dash-table-container { flex: 1 1 auto; }
.mp-page-upload-interface .up-ae-confirm { align-self: flex-end; margin-right: .9rem; height: 2.6em; font-size: 1rem; }
.mp-page-upload-interface .up-ae .dash-spreadsheet-inner table { width: 75% !important; table-layout: fixed; }

/* checklist card — geometry from SS 1.57.35 PM (2x) / 1.42.44 PM / 2.03.45 PM: light panel with a 1px border and
 * 6px radius (no shadow), 16px/20px padding, the letter-spaced title on ONE line, a 10px progress bar, 37px item
 * pitch. Hub colours: #F9F9F9 panel, #C8C8C8 border, a black track with a yellow fill (yellow on black is allowed),
 * green fill + AA green "100%" once every item is resolved. */
.mp-page-upload-interface .up-checklist-card {
  background: var(--up-bg-light); border-radius: 6px; padding: 1rem 1.25rem; border: 1px solid var(--up-border); box-shadow: none;
}
.mp-page-upload-interface .up-checklist-title {
  font-size: 1.03rem; line-height: 1.5; font-weight: 700; letter-spacing: .09em; color: var(--up-ink); margin-bottom: .65rem;
  font-family: var(--hub-font-heading, Arial, Helvetica, sans-serif);
}
.mp-page-upload-interface .up-progress-row { display: flex; align-items: center; gap: .55rem; margin-bottom: .78rem; }
.mp-page-upload-interface .up-progress-track { flex: 1 1 auto; height: 10px; border-radius: 5px; background: var(--up-ink); overflow: hidden; }
.mp-page-upload-interface .up-progress-fill { height: 100%; background: var(--up-yellow); border-radius: 5px; transition: width .25s ease; }
.mp-page-upload-interface .up-progress-fill.is-complete { background: var(--up-success); }
.mp-page-upload-interface .up-progress-pct {
  font-size: .75rem; line-height: 1.5; font-weight: 700; color: var(--up-ink); letter-spacing: .03em; min-width: 2.1rem; text-align: right;
}
.mp-page-upload-interface .up-progress-pct.is-complete { color: var(--up-success-text); }
.mp-page-upload-interface .up-checklist-item {
  padding: .4rem 0; line-height: 1.5; border-bottom: 1px solid var(--up-band); font-size: .95rem; font-weight: 600; color: var(--up-ink);
}
.mp-page-upload-interface .up-checklist-item:last-child { border-bottom: none; }
.mp-page-upload-interface .up-checklist-item.is-done { color: var(--up-muted); font-weight: 400; text-decoration: line-through; }

/* red acknowledgement boxes (SS 1.42.44): danger background, dark text (AA, as the shell's danger toasts) */
.mp-page-upload-interface .up-warn {
  margin: .6rem 0 0 -.5rem; padding: 1.4rem 1.6rem 1.2rem; border-radius: 0; background: var(--up-danger);
  color: var(--up-ink); font-size: 1.05rem;
}
.mp-page-upload-interface .up-warn[hidden] { display: none; }
.mp-page-upload-interface .up-warn-text { margin-bottom: .7rem; line-height: 1.55; }
.mp-page-upload-interface .up-ack label,
.mp-page-upload-interface .up-ack-label { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; letter-spacing: .02em; cursor: pointer; color: var(--up-ink); }
.mp-page-upload-interface .up-ack-input { width: 14px; height: 14px; margin: 0; accent-color: var(--up-ink); }

/* ------------------------------------------------------------------ AG-like grid */
.mp-page-upload-interface .up-grid-wrap {
  display: flex; align-items: stretch; margin-top: .7rem; border: 1px solid var(--up-ag-border); background: #fff;
  min-height: 220px;
}
/* side bar: hub black with white labels and yellow icon discs (black glyphs); hover/focus turn the label yellow */
.mp-page-upload-interface .up-sidebar {
  flex: 0 0 51px; display: flex; flex-direction: column; align-items: center; gap: 1.6rem; padding: 14px 0;
  background: var(--up-ink); border-right: 1px solid var(--up-ag-border);
}
.mp-page-upload-interface .up-sidebar-button {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent;
  color: #fff; cursor: pointer; font: inherit;
}
.mp-page-upload-interface .up-sidebar-button:hover,
.mp-page-upload-interface .up-sidebar-button:focus-visible { color: var(--up-yellow); }
.mp-page-upload-interface .up-sidebar :focus-visible { outline: 2px solid var(--up-yellow); outline-offset: 2px; }
.mp-page-upload-interface .up-sidebar-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--up-yellow);
}
.mp-page-upload-interface .up-sidebar-glyph { display: block; width: 16px; height: 16px; background: var(--up-ink); }
.mp-page-upload-interface .up-glyph-columns {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 2h14v12H1z M3 4v8h2V4z M7 4v8h2V4z M11 4v8h2V4z' fill='black' fill-rule='evenodd'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 2h14v12H1z M3 4v8h2V4z M7 4v8h2V4z M11 4v8h2V4z' fill='black' fill-rule='evenodd'/%3E%3C/svg%3E") center/contain no-repeat;
}
.mp-page-upload-interface .up-glyph-filters {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 2h13l-5 6v5l-3 1.5V8z' fill='none' stroke='black' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 2h13l-5 6v5l-3 1.5V8z' fill='none' stroke='black' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.mp-page-upload-interface .up-sidebar-label { writing-mode: vertical-rl; font-size: 1rem; letter-spacing: .02em; }
.mp-page-upload-interface .up-toolpanel {
  flex: 0 0 200px; padding: .75rem 1rem; border-right: 1px solid var(--up-ag-border); background: #fff; font-size: 14px;
}
.mp-page-upload-interface .up-toolpanel[hidden] { display: none; }
.mp-page-upload-interface .up-toolpanel-title { font-weight: 700; margin-bottom: .5rem; color: var(--up-ag-text); }
.mp-page-upload-interface .up-colpick label,
.mp-page-upload-interface .up-colpick-label { display: flex; align-items: center; gap: .5rem; padding: .2rem 0; cursor: pointer; }
.mp-page-upload-interface .up-colpick-input { accent-color: var(--up-check); margin: 0; }
.mp-page-upload-interface .up-grid-main { position: relative; flex: 1 1 auto; min-width: 0; }
.mp-page-upload-interface .up-grid-all {
  position: absolute; z-index: 3; left: 1px; top: 1px; height: 46px; display: inline-flex; align-items: center; gap: 14px;
  padding: 0 14px 0 22px; border: 0; background: var(--up-ag-header); color: var(--up-ag-text); font-size: 14px;
  font-weight: 700; cursor: pointer;
}
.mp-page-upload-interface .up-grid-edit .up-grid-all { padding: 0 0 0 22px; }

/* DataTable → AG Grid look in hub colours */
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-container { max-height: 640px; }
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner table { table-layout: fixed; width: 100% !important; }
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner th,
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner td { position: relative; }
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner th.dash-header:not(:last-child)::after {
  content: ""; position: absolute; right: 0; top: 50%; height: 30%; transform: translateY(-50%); width: 2px; background: var(--up-border);
}
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner td.dash-select-cell,
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner th.dash-select-header {
  width: auto !important; min-width: 0 !important; max-width: none !important; text-align: left;
  padding: 0 17px 0 22px !important; background-clip: padding-box; text-align: left !important;
}
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner td.dash-select-cell > * { text-align: left; }
/* AG Grid shows no sort glyph until a column is sorted: keep DataTable's sort toggle, revealed on hover */
.mp-page-upload-interface .up-grid-main .column-header--sort {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); opacity: 0; color: var(--up-muted);
}
.mp-page-upload-interface .up-grid-main th:hover .column-header--sort { opacity: .8; }
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner th.dash-select-header { background: var(--up-ag-header); }
.mp-page-upload-interface .up-grid-upload .dash-spreadsheet-inner td.dash-select-cell { border-right: 1px solid var(--up-ag-row) !important; }
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner td.dash-select-cell input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0; accent-color: var(--up-check); vertical-align: middle; cursor: pointer;
}
.mp-page-upload-interface .up-grid-edit .dash-spreadsheet-inner td.dash-select-cell,
.mp-page-upload-interface .up-grid-edit .dash-spreadsheet-inner th.dash-select-header {
  width: 52px !important; min-width: 52px !important; max-width: 52px !important; padding: 0 0 0 22px !important;
}
/* active / selected cell: link-blue border on a pale blue fill (grid.BASE_CONDITIONAL "state" rules replace
 * DataTable's default hot-pink highlight); the cell editor keeps the column's left alignment */
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner td.dash-cell:focus,
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner td.dash-cell.focused { outline: 1px solid var(--up-link); }
.mp-page-upload-interface .dash-spreadsheet-container .dash-spreadsheet-inner td.dash-cell input.dash-cell-value:not([type=checkbox]) {
  text-align: left; color: var(--up-ink);
}
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner tr:hover td { background-color: var(--up-hover) !important; }
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner th.dash-filter {
  height: 38px; padding: 0 !important; background: #fff; border-bottom: 1px solid var(--up-ag-row) !important;
}
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner th.dash-filter input.dash-filter--case { display: none; }
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner th.dash-filter input:not(.dash-filter--case) {
  position: absolute; left: 6px; right: 6px; top: 5px; bottom: 5px; width: calc(100% - 12px); height: auto;
  padding: 0 8px !important; font-size: 13px; text-align: left; border: 1px solid var(--up-border); border-radius: 3px; background: #fff;
}
.mp-page-upload-interface .up-grid-main .dash-spreadsheet-inner th.dash-filter input:not(.dash-filter--case):focus {
  border-color: var(--up-link); outline: none; box-shadow: 0 0 0 .125em rgba(63, 97, 196, .25);
}

/* ------------------------------------------------------------------ Edit tab */
.mp-page-upload-interface .up-edit-actions { margin-top: 1.05rem; }
.mp-page-upload-interface .up-edit-actions .up-actions-left { gap: .55rem; }
.mp-page-upload-interface .up-del-cols { width: 232px; font-size: .95rem; }
.mp-page-upload-interface .up-del-cols .dash-dropdown-trigger { min-height: 2.1rem; }
.mp-page-upload-interface .up-edit-work { display: flex; justify-content: flex-end; margin-top: .55rem; }
.mp-page-upload-interface .up-edit-work .up-right { width: 22.6%; min-width: 260px; }
.mp-page-upload-interface .up-edit-pane .up-grid-wrap { margin-top: .35rem; }

/* ------------------------------------------------------------------ toasts / progress
 * Colours come from the shell (success #48C78E / danger #F14668 / warning #FFDC00 / info #E2E7F6, all with
 * #181716 text). Auto-hide after 8 s (MASTER G-19) is driven by a clientside timer that adds .up-toast-hidden,
 * instead of the shell's delayed CSS animation, so headless screenshots (animations fast-forwarded)
 * still show the toast. */
.mp-page-upload-interface .up-toasts .mp-toast {
  font-size: 1.05rem; line-height: 1.55; animation: none; color: var(--up-ink);
  transition: opacity .6s ease, transform .6s ease, visibility 0s linear 0s;
}
.mp-page-upload-interface .up-toasts .mp-toast.is-info { border-left: 4px solid var(--up-link); }
.mp-page-upload-interface .up-toasts .mp-toast.up-toast-hidden {
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .6s ease, transform .6s ease, visibility 0s linear .6s;
}
.mp-page-upload-interface .up-progress[hidden] { display: none; }
.mp-page-upload-interface .up-progress .mp-toast {
  animation: none; display: flex; align-items: center; gap: .6rem; color: var(--up-ink); border-left: 4px solid var(--up-link);
}
.mp-page-upload-interface .up-spinner {
  flex: 0 0 auto; width: 1em; height: 1em; border-radius: 50%; border: 2px solid rgba(24, 23, 22, .25);
  border-top-color: var(--up-ink); animation: up-spin .8s linear infinite;
}
@keyframes up-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ narrow screens */
@media screen and (max-width: 1023px) {
  .mp-page-upload-interface .up-work { grid-template-columns: 1fr; gap: 1rem; }
  .mp-page-upload-interface .up-middle { padding: 0; }
  .mp-page-upload-interface .up-edit-work .up-right { width: 100%; }
  .mp-page-upload-interface .up-load { margin-left: 1rem; }
}
