/* Event Venue Load-In Run Sheet Builder — quiet, dense B2B workspace styling. */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --band: #f2f4f7;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #1d2330;
  --muted: #475467;
  --faint: #5d6778;
  --accent: #1849a9;
  --accent-hover: #133b87;
  --focus-ring: #1849a9;
  --green-bg: #ecfdf3; --green-bd: #abefc6; --green-tx: #05603a;
  --amber-bg: #fffaeb; --amber-bd: #fedf89; --amber-tx: #7a2e0e;
  --blue-bg: #eff4ff; --blue-bd: #b2ccff; --blue-tx: #1d3f8c;
  --red-bg: #fef3f2; --red-bd: #fecdca; --red-tx: #9a1c13;
  --gray-bg: #f2f4f7; --gray-bd: #d0d5dd; --gray-tx: #344054;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --header-h: 52px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font-sans);
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
button, [role="button"], a, label[for], summary, select, input[type="checkbox"], input[type="file"] { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.num, input[type="number"], input[type="time"], input[type="date"] { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); }
.skip-link:focus { top: 8px; }

/* ---------- buttons ---------- */
.btn, .btn-primary, .link-btn, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 12px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; text-decoration: none;
}
.btn { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); box-shadow: var(--shadow); }
.btn:hover { background: var(--surface-2); border-color: #98a2b3; }
.btn-quiet { box-shadow: none; border-color: var(--border); }
.btn-dark { background: #1d2330; border-color: #1d2330; color: #fff; }
.btn-dark:hover { background: #343c4c; border-color: #343c4c; }
.btn-primary { background: var(--accent); border: 1px solid var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .65; cursor: progress; }
.btn[disabled]:not([aria-busy]) { cursor: not-allowed; }
.link-btn { min-height: 0; padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.icon-btn { width: 36px; padding: 0; background: transparent; border: 1px solid transparent; color: var(--muted); font-size: 20px; font-weight: 400; }
.icon-btn:hover { background: var(--band); color: var(--text); }

/* ---------- header ---------- */
.app-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner {
  max-width: 1600px; margin: 0 auto; padding: 0 20px; min-height: var(--header-h);
  display: flex; align-items: center; gap: 20px;
}
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 14.5px; letter-spacing: -0.01em; flex: 0 0 auto; min-height: 44px; }
.wordmark-mark { width: 22px; height: 22px; border-radius: 5px; background: #1d2330; position: relative; flex: 0 0 auto; }
.wordmark-mark::before, .wordmark-mark::after { content: ""; position: absolute; left: 5px; right: 5px; height: 2px; background: #fff; border-radius: 1px; }
.wordmark-mark::before { top: 7px; }
.wordmark-mark::after { top: 12px; right: 9px; }
.wordmark-short { display: none; }
.app-header #saas-shell-bar {
  background: transparent; border: 0; color: var(--text); padding: 0; font-size: 13.5px;
  display: flex; gap: 2px; align-items: stretch; align-self: stretch; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none;
}
.app-header #saas-shell-bar::-webkit-scrollbar { display: none; }
.nav-tab {
  position: relative; background: transparent; border: 0; padding: 0 12px; min-height: 44px; min-width: 44px;
  color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap;
}
.nav-tab:hover { color: var(--text); }
.nav-tab[aria-current="page"] { color: var(--text); }
.nav-tab[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: var(--text); border-radius: 2px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ---------- layout ---------- */
.app-body { max-width: 1600px; margin: 0 auto; padding: 0 20px; }
.workbench-frame { padding: 16px 0 28px; }
.page-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-bottom: 12px; }
.page-title h1 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; min-height: 19px; max-width: 70ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.select-compact { min-height: 36px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); font-size: 16px; max-width: 290px; }

.persist-bar {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px 16px; align-items: start;
  padding: 8px 12px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px;
}
.persist-status { font-weight: 600; min-height: 19px; }
.persist-status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: #98a2b3; }
.persist-status[data-persist="cloud"]::before { background: #12b76a; }
.persist-status[data-persist="restored"]::before { background: #f79009; }
.action-feedback { min-height: 38px; color: var(--muted); text-align: right; }
.action-feedback[data-kind="hint"] { color: var(--muted); }
.action-feedback[data-kind="error"] { color: var(--red-tx); font-weight: 600; }
.action-feedback[data-kind="ok"] { color: var(--green-tx); }
.persist-note, .persist-signedout, .free-reassurance { color: var(--muted); grid-column: 1 / -1; }
.free-reassurance { padding: 6px 8px; border: 1px solid var(--blue-bd); border-radius: 4px; background: var(--blue-bg); color: var(--blue-tx); font-size: 12.5px; }

.workbench-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.work-main { display: grid; gap: 16px; min-width: 0; }

/* ---------- facts panel ---------- */
.facts-panel, .grid-panel, #executive-deliverable, .csv-import-drawer, .hub-frame {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
}
.facts-panel { padding: 14px 14px 16px; }
.panel-title { font-size: 14px; font-weight: 700; }
.panel-sub { color: var(--muted); font-size: 12.5px; margin: 2px 0 12px; }
.field { display: grid; gap: 4px; margin-bottom: 10px; min-width: 0; }
.field label, .map-field label { font-size: 12.5px; font-weight: 600; color: var(--text); display: flex; justify-content: space-between; gap: 8px; }
.req, .opt { font-weight: 500; font-size: 11.5px; color: var(--faint); }
.req { color: var(--muted); }
.field-pair { display: grid; grid-template-columns: 1fr; gap: 8px; }
.field input, .field textarea, .field select, .input-compact, .map-field select {
  width: 100%; min-width: 0; min-height: 38px; padding: 7px 9px; font-size: 16px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.field textarea { resize: vertical; min-height: 58px; line-height: 1.4; }
.field input:hover, .field textarea:hover { border-color: #98a2b3; }
[aria-invalid="true"] { border-color: #d92d20 !important; box-shadow: 0 0 0 1px #d92d20 inset; }
.field-error { color: var(--red-tx); font-size: 12.5px; font-weight: 600; }

.files-panel { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; }
.file-label { font-size: 12.5px; font-weight: 600; display: flex; justify-content: space-between; margin-bottom: 4px; }
input[type="file"] { width: 100%; max-width: 100%; font-size: 14px; color: var(--muted); }
input[type="file"]::file-selector-button {
  margin-right: 10px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: 600 13.5px var(--font-sans); cursor: pointer;
}
.file-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.file-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.file-main { display: grid; min-width: 0; }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: var(--muted); font-size: 12px; }
.file-req { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; min-height: 36px; }
.file-empty { font-size: 13px; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--gray-bd); background: var(--gray-bg); color: var(--gray-tx); white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.chip[data-status="ready"] { background: var(--green-bg); border-color: var(--green-bd); color: var(--green-tx); }
.chip[data-status="exported"] { background: var(--blue-bg); border-color: var(--blue-bd); color: var(--blue-tx); }
.chip[data-status="sent"] { background: #f4f3ff; border-color: #d9d6fe; color: #4a1fb8; }
.chip[data-status="needs_review"] { background: var(--amber-bg); border-color: var(--amber-bd); color: var(--amber-tx); }
.chip[data-status="error"] { background: var(--red-bg); border-color: var(--red-bd); color: var(--red-tx); }
.chip[data-status="excluded"] { background: var(--surface); color: var(--muted); border-style: dashed; }

/* ---------- grid ---------- */
.grid-panel { overflow: hidden; }
.table-toolbar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.toolbar-meta { color: var(--muted); font-size: 12.5px; flex: 1 1 auto; }
.table-toolbar-actions { display: flex; gap: 6px; }
.table-scroll { overflow-x: auto; overflow-y: visible; position: relative; min-height: 380px; background: var(--surface); }
.table-scroll:focus-visible { outline-offset: -2px; }
.reconcile-grid-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; min-width: 100%; font-size: 14px; }
.reconcile-grid-table col.col-expand { width: 48px; }
.reconcile-grid-table col.col-recipient { width: 224px; }
.reconcile-grid-table col.col-role { width: 176px; }
.reconcile-grid-table col.col-contact { width: 240px; }
.reconcile-grid-table col.col-vehicle { width: 180px; }
.reconcile-grid-table col.col-height { width: 92px; }
.reconcile-grid-table col.col-arrival { width: 264px; }
.reconcile-grid-table col.col-dock { width: 160px; }
.reconcile-grid-table col.col-status { width: 172px; }
.reconcile-grid-table col.col-include { width: 78px; }
.reconcile-grid-table col.col-actions { width: 56px; }
.reconcile-grid-table th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--muted); text-align: left;
  font-size: 12.5px; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); white-space: nowrap;
}
.reconcile-grid-table td { padding: 3px 4px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); vertical-align: middle; background: var(--surface); }
.reconcile-grid-table .col-expand, .reconcile-grid-table .col-recipient { position: sticky; z-index: 1; }
.reconcile-grid-table th.col-expand, .reconcile-grid-table th.col-recipient { z-index: 3; }
.reconcile-grid-table .col-expand { left: 0; text-align: center; }
.reconcile-grid-table .col-recipient { left: 48px; box-shadow: 1px 0 0 var(--border); }
.reconcile-grid-table .col-status { position: sticky; right: 0; z-index: 1; box-shadow: -1px 0 0 var(--border); }
.reconcile-grid-table th.col-status { z-index: 3; }
.reconcile-grid-table th.col-height { text-align: right; }
.reconcile-grid-table td.col-include, .reconcile-grid-table th.col-include { text-align: center; }
.rec-row:hover td { background: #fafbfc; }
.rec-row.is-selected td { background: #f5f8ff; }
.rec-row.is-selected td.col-expand { box-shadow: inset 2px 0 0 var(--accent); }
.cell-input {
  width: 100%; min-width: 0; min-height: 38px; padding: 6px 8px; font-size: 16px; line-height: 1.3;
  border: 1px solid transparent; border-radius: 4px; background: transparent; text-overflow: ellipsis;
}
.cell-input:hover { border-color: var(--border-strong); background: var(--surface); }
.cell-input:focus { border-color: var(--accent); background: var(--surface); outline: none; box-shadow: 0 0 0 2px rgba(24, 73, 169, .18); }
.cell-input::placeholder { color: #8a93a3; }
.cell-input.has-conflict { color: var(--amber-tx); background: var(--amber-bg); }
.col-height .cell-input { text-align: right; }
.cell-select { padding-right: 4px; }
.time-pair { display: grid; grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr); align-items: center; gap: 2px; }
.time-sep { text-align: center; color: var(--muted); }
.col-status { white-space: nowrap; }
.col-status .chip { margin-left: 4px; }
.origin-tag { display: block; margin: 2px 0 0 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check-target { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.check-target input, .check-item input, .file-req input { width: 18px; height: 18px; accent-color: #1d2330; }
.expand-btn { width: 38px; height: 38px; border: 1px solid transparent; border-radius: 4px; background: transparent; display: inline-flex; align-items: center; justify-content: center; }
.expand-btn:hover { background: var(--band); }
.chev { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .12s ease; }
.expand-btn[aria-expanded="true"] .chev { transform: rotate(45deg); }

.detail-row > td { padding: 0; background: var(--surface-2); border-right: 0; }
.detail-inner {
  position: sticky; left: 0; width: var(--scroll-w, 100%); max-width: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; padding: 12px 14px 14px;
}
.reconcile-grid-table .detail-row > td { max-width: none; }
.check-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.check-group-head { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; background: var(--band); font-size: 12.5px; font-weight: 600; color: var(--gray-tx); }
.check-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 7px 10px; border-top: 1px solid var(--border); font-size: 13.5px; }
.check-item:first-of-type { border-top: 0; }
.check-item input { margin-top: 1px; }
.check-item label { cursor: pointer; line-height: 1.45; }
.check-item.is-done label { color: var(--muted); }
.tag { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.tag-changed { background: var(--amber-bg); color: var(--amber-tx); border: 1px solid var(--amber-bd); }
.detail-side { display: grid; gap: 4px; align-content: start; }
.detail-issues { font-size: 13px; }
.issue-list { margin: 0 0 8px; padding-left: 18px; }
.issue-missing { color: var(--red-tx); }
.issue-conflict { color: var(--amber-tx); }
.issue-ok { color: var(--green-tx); margin-bottom: 8px; }
.detail-actions { display: grid; gap: 6px; }
.detail-feedback { font-size: 12.5px; color: var(--muted); min-height: 18px; }

.table-foot { display: flex; gap: 18px; flex-wrap: wrap; padding: 9px 12px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 13px; color: var(--muted); }
.table-foot strong { color: var(--text); }

/* ---------- deliverable ---------- */
#executive-deliverable { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
.deliv-status { padding: 14px 16px; border-right: 1px solid var(--border); display: grid; gap: 8px; align-content: start; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.verdict { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 8px; }
.verdict::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #d92d20; }
.verdict[data-verdict="review"]::before { background: #dc6803; }
.verdict[data-verdict="ready"]::before { background: #12b76a; }
.verdict-summary { color: var(--muted); font-size: 13px; min-height: 38px; }
.req-wrap { min-height: 162px; border: 1px solid var(--border); border-radius: var(--radius); }
.req-more { justify-self: start; min-height: 32px; }
.req-list { list-style: none; margin: 0; padding: 0; }
.req-item { padding: 6px 10px 6px 28px; border-bottom: 1px solid var(--border); font-size: 13px; position: relative; }
.req-item::before { content: ""; position: absolute; left: 10px; top: 11px; width: 8px; height: 8px; border-radius: 50%; }
.req-missing::before { background: #d92d20; }
.req-review::before { background: #dc6803; }
.req-ok::before { background: #12b76a; }
.export-note { font-size: 12.5px; color: var(--muted); }
.last-export { font-size: 12.5px; min-height: 36px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.deliv-preview { padding: 14px 16px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.preview-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.logo-control { display: grid; gap: 4px; min-width: 0; max-width: 100%; }
.logo-control label { font-size: 12.5px; font-weight: 600; display: flex; gap: 8px; flex-wrap: wrap; }
.logo-status { font-size: 12.5px; color: var(--muted); min-height: 36px; }
.sheet-preview { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); min-height: 340px; }
.sheet-preview-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.sheet-preview-name { font-size: 16px; font-weight: 700; }
#deliverable-logo { max-height: 44px; max-width: 140px; object-fit: contain; }
.preview-group { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 0 4px; }
.preview-items { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 3px; }

/* ---------- CSV drawer ---------- */
.csv-import-drawer { margin-bottom: 12px; }
.csv-import-drawer > summary { padding: 10px 14px; font-weight: 600; font-size: 13.5px; min-height: 44px; display: flex; align-items: center; list-style: none; }
.csv-import-drawer > summary::-webkit-details-marker { display: none; }
.csv-import-drawer > summary::before { content: ""; width: 7px; height: 7px; margin-right: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .12s; }
.csv-import-drawer[open] > summary::before { transform: rotate(45deg); }
.csv-body { padding: 0 14px 14px; display: grid; gap: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.csv-intro { color: var(--muted); font-size: 13px; }
.csv-sources { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.csv-source { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 0; display: grid; gap: 6px; min-width: 0; }
.csv-source legend { font-weight: 700; padding: 0 4px; font-size: 13px; }
.csv-source > label { font-size: 12.5px; font-weight: 600; }
.csv-source textarea { width: 100%; font-size: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); resize: vertical; }
.csv-meta { font-size: 12.5px; color: var(--muted); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 10px; margin-top: 6px; }
.map-field { display: grid; gap: 3px; min-width: 0; }
.csv-summary { font-size: 13px; font-weight: 600; min-height: 19px; }
.csv-preview-scroll { overflow-x: auto; max-height: 280px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.csv-preview { border-collapse: collapse; width: 100%; font-size: 13px; }
.csv-preview th, .csv-preview td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.csv-preview th { background: var(--surface-2); color: var(--muted); position: sticky; top: 0; }
.csv-preview tr.is-unmatched td:first-child { color: var(--amber-tx); font-weight: 600; }
.csv-preview caption { caption-side: bottom; padding: 6px; font-size: 12px; color: var(--muted); text-align: left; }
.csv-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.csv-actions .input-compact { width: 220px; min-height: 36px; }
.csv-profile-feedback { flex-basis: 100%; font-size: 12.5px; color: var(--muted); min-height: 18px; }

/* ---------- hub ---------- */
#saas-management-hub { padding: 16px 0 28px; min-height: 520px; }
.hub-frame { padding: 16px; display: grid; gap: 12px; }
.hub-head h1 { font-size: 18px; }
.hub-notice { min-height: 19px; font-size: 13px; color: var(--muted); }
.hub-notice[data-kind="ok"] { color: var(--green-tx); }
.hub-notice[data-kind="error"] { color: var(--red-tx); font-weight: 600; }
.hub-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hub-table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.hub-table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 13.5px; }
.hub-table th { text-align: left; font-size: 12.5px; color: var(--muted); background: var(--surface-2); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.hub-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.hub-table tr:hover td { background: #fafbfc; }
.hub-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 2fr) auto; gap: 8px 10px; align-items: end; }
.hub-form .field { margin: 0; }
.hub-form .btn { min-height: 38px; }
.workspace-state { margin: 0; }
.workspace-state button { font-weight: 600; }
.skeleton-table { display: grid; gap: 8px; }
.skeleton-row { height: 38px; border-radius: 4px; background: linear-gradient(90deg, var(--band), #fafbfc, var(--band)); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton-row { animation: none; } * { transition: none !important; } }
.recovered-card { border: 1px dashed #f79009; background: var(--amber-bg); border-radius: var(--radius); padding: 12px; display: grid; gap: 6px; justify-items: start; }
.billing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.hub-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 8px; align-content: start; justify-items: start; }
.plan-name { font-size: 18px; font-weight: 700; }

/* ---------- toast & dialogs ---------- */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; max-width: calc(100vw - 24px);
  background: #1d2330; color: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(16, 24, 40, .2); font-size: 13.5px;
}
.toast .btn { background: transparent; color: #fff; border-color: #667085; box-shadow: none; }
.toast .btn:hover { background: #343c4c; }
.toast .icon-btn { color: #d0d5dd; }
.toast .icon-btn:hover { background: #343c4c; color: #fff; }

.dialog { border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); color: var(--text); box-shadow: 0 20px 48px rgba(16, 24, 40, .18); }
#restore-dialog, #preset-confirm-dialog, #account-dialog { width: min(460px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(16, 24, 40, .4); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.dialog-head h2 { font-size: 17px; line-height: 1.3; }
.dialog-lead { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; }
.dialog-note { font-size: 12.5px; color: var(--muted); margin: 10px 0; min-height: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
#account-form .dialog-actions { justify-content: space-between; }
.paywall-reason { padding: 10px 12px; border-radius: var(--radius); background: var(--amber-bg); border: 1px solid var(--amber-bd); color: var(--amber-tx); font-weight: 600; font-size: 13.5px; margin-bottom: 10px; }
.dialog-table { min-height: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.free-vs-pro-table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 13.5px; }
.free-vs-pro-table th, .free-vs-pro-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.free-vs-pro-table thead th { background: var(--surface-2); color: var(--muted); font-size: 12.5px; }
.free-vs-pro-table tbody th { font-weight: 600; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.trust-footer { max-width: 1600px; margin: 0 auto; padding: 14px 20px; font-size: 12.5px; color: var(--muted); }
.trust-footer a { color: var(--accent); }
.print-root { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .wordmark-full { display: none; }
  .wordmark-short { display: inline; }
  #executive-deliverable { grid-template-columns: minmax(0, 1fr); }
  .deliv-status { border-right: 0; border-bottom: 1px solid var(--border); }
}
@media (max-width: 1100px) {
  .workbench-grid { grid-template-columns: 260px minmax(0, 1fr); }
  .detail-inner { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding: 0 12px; }
  .app-header #saas-shell-bar { grid-column: 1 / -1; grid-row: 2; border-top: 1px solid var(--border); margin: 0 -12px; padding: 0 6px; }
  .app-body { padding: 0 12px; }
  .workbench-grid { grid-template-columns: minmax(0, 1fr); }
  .persist-bar { grid-template-columns: minmax(0, 1fr); }
  .persist-status { min-height: 19px; text-align: left; }
  .action-feedback { min-height: 38px; text-align: left; }
  .field input, .field textarea, .field select, .input-compact, .map-field select, .csv-actions .input-compact { min-height: 44px; }
  .csv-sources { grid-template-columns: minmax(0, 1fr); }
  .hub-form { grid-template-columns: minmax(0, 1fr); }
  .page-sub { white-space: normal; }
  .btn, .icon-btn, .select-compact, .btn-primary, .expand-btn, .file-req, .link-btn { min-height: 44px; }
  .icon-btn, .expand-btn { min-width: 44px; }
  .cell-input { min-height: 44px; }
  .check-item { min-height: 44px; align-items: center; }
  .check-item input { width: 22px; height: 22px; }
  .link-btn { min-height: 0; padding: 13px 2px; margin: -13px 0; display: inline; }
  .link-btn.req-more { display: inline-flex; min-height: 44px; padding: 0 2px; margin: 0; }
  .reconcile-grid-table col.col-expand { width: 52px; }
  .reconcile-grid-table .col-recipient { left: 52px; }
}
@media (max-width: 420px) {
  .wordmark-mark { display: none; }
  .header-actions .btn-primary { font-size: 12px !important; padding: 6px 8px !important; }
  .header-inner { gap: 0 8px; }
}
@media (max-width: 520px) {
  .wordmark { font-size: 13px; gap: 7px; }
  .wordmark-mark { width: 18px; height: 18px; }
  .wordmark-mark::before { top: 5px; left: 4px; right: 4px; }
  .wordmark-mark::after { top: 10px; left: 4px; right: 7px; }
  .header-actions .btn-primary { font-size: 12.5px; padding: 6px 10px; }
  .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .toolbar-actions .select-compact { grid-column: 1 / -1; max-width: none; width: 100%; }
  .page-toolbar { align-items: stretch; }
  .reconcile-grid-table col.col-recipient { width: 212px; }
  .reconcile-grid-table td.col-status { position: static; box-shadow: none; }
  .reconcile-grid-table th.col-status { right: auto; box-shadow: none; }
  .wordmark { white-space: nowrap; }
  .table-scroll { min-height: 340px; }
  .field-pair { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toast { left: 12px; right: 12px; transform: none; }
}

/* Secondary controls disclose intentionally; task entry stays above the mobile fold. */
.toolbar-actions-menu { position: relative; }
.toolbar-actions-menu > summary { min-height: 44px; list-style: none; display: flex; align-items: center; justify-content: center; }
.toolbar-actions-menu > summary::-webkit-details-marker { display: none; }
.toolbar-menu-items { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 180px; display: grid; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); box-shadow: 0 6px 18px #0002; }
.toolbar-menu-items .btn { width: 100%; min-height: 44px; }
.persistence-details { grid-column: 1 / -1; }
.persistence-details > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-size: 13px; color: var(--muted); }
.persistence-details p { margin-top: 8px; }
.action-feedback:empty { display: none; min-height: 0; }
@media(max-width:860px) {
  .link-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 4px 8px; margin: 0; }
  input[type="file"] { min-height: 44px; padding: 8px; max-width: 100%; }
  input[type="file"]::file-selector-button { min-height: 28px; cursor: pointer; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; }
  .app-header, .app-body, .site-footer, .toast, dialog, .skip-link { display: none !important; }
  .print-root { display: block !important; }
}
