:root {
  --xo-red: #ED1C24;
  --xo-red-dark: #B8141A;
  --xo-red-tint: #FAD0D2;
  --xo-dark: #353535;
  --xo-dark-2: #262626;
  --xo-mid-gray: #6D6D6D;
  --xo-silver: #BFBFBF;
  --xo-shaded: #E6E6E6;
  --xo-active-blue: #C8D9EF;
  --xo-active-border: #5A78A0;
  --xo-bg: #F3F4F6;
  --xo-card: #FFFFFF;
  --xo-border: #D1D5DB;
  --xo-text: #111827;
  --xo-muted: #6B7280;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --sticky-title-max: 185px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--xo-dark-2);
  color: var(--xo-text);
  font-family: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.hidden { display: none !important; }
.only-print { display: none; }

#app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: var(--xo-bg);
}

/* --- Top Brand & Status Header --- */
#top-brand-bar {
  padding-top: calc(var(--safe-top) + 6px);
  padding-bottom: 6px;
  padding-left: max(12px, calc(var(--safe-left) + 10px));
  padding-right: max(12px, calc(var(--safe-right) + 10px));
  background: var(--xo-dark-2);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #484848;
  flex-shrink: 0;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  cursor: pointer;
}

.brand-wordmark {
  height: 13px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.brand-year {
  font-size: 12px;
  font-weight: 700;
  color: #D1D5DB;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.brand-project-pill {
  background: rgba(255,255,255,0.12);
  color: #F9FAFB;
  border: 1px solid rgba(255,255,255,0.16);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.brand-project-pill:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.34);
}
.brand-project-pill.open {
  background: rgba(237, 28, 36, 0.24);
  border-color: var(--xo-red);
  color: #FFFFFF;
}

/* --- Top-Bar Quick Bid File Switcher Dropdown --- */
.bid-quick-dropdown {
  position: fixed;
  z-index: 1200;
  background: #1B1E25;
  color: #F3F4F6;
  border: 1px solid #3C4352;
  border-top: 2px solid var(--xo-red);
  border-radius: 9px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.52);
  min-width: 270px;
  max-width: min(430px, calc(100vw - 16px));
  overflow: hidden;
}
.bqd-hdr {
  padding: 7px 11px 6px;
  background: #13151A;
  border-bottom: 1px solid #2B303B;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #9CA3AF;
  text-transform: uppercase;
}
.bqd-count {
  background: #282D37;
  color: #E5E7EB;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}
.bqd-list {
  max-height: min(340px, 58dvh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bqd-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #E5E7EB;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.bqd-item:hover,
.bqd-item:focus {
  background: #282D38;
  border-color: #464E5E;
  outline: none;
}
.bqd-item.active {
  background: rgba(237, 28, 36, 0.17);
  border-color: rgba(237, 28, 36, 0.65);
  color: #FFFFFF;
}
.bqd-item-main {
  min-width: 0;
  flex: 1;
}
.bqd-item-title {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bqd-item-sub {
  font-size: 10.5px;
  color: #9CA3AF;
  margin-top: 1px;
}
.bqd-item.active .bqd-item-sub {
  color: #D1D5DB;
}
.bqd-item-dot {
  color: var(--xo-red);
  margin-right: 5px;
  font-size: 10px;
}
.bqd-item-chk {
  color: #FF6B72;
  font-size: 12px;
  font-weight: 900;
  flex-shrink: 0;
}
.bqd-ftr {
  padding: 6px 8px;
  background: #13151A;
  border-top: 1px solid #2B303B;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}
.bqd-ftr-btn {
  background: #262B35;
  color: #E5E7EB;
  border: 1px solid #3E4656;
  border-radius: 5px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.bqd-ftr-btn:hover {
  background: #323846;
}
.bqd-ftr-btn.red {
  background: var(--xo-red);
  border-color: var(--xo-red-dark);
  color: #FFFFFF;
}
.bqd-ftr-btn.red:hover {
  background: var(--xo-red-dark);
  border-color: #FF6B72;
}

.offline-ready-dot {
  font-size: 9.5px;
  font-weight: 800;
  color: #34D399;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.35);
  padding: 2px 6px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.dark-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #1C1E24;
  color: #E5E7EB;
  border: 1px solid #525866;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  /* Extra spacing separating Dark Mode toggle from [ESTIMATE + Files] group */
  margin-right: 11px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.dark-mode-btn:hover {
  background: #2A2E37;
  border-color: #7B8496;
}
.dark-mode-btn.active {
  background: #2B4365;
  color: #F9FAFB;
  border-color: #63B3ED;
}
.dm-icon {
  font-size: 12.5px;
  line-height: 1;
}

.grand-pill {
  background: #181818;
  border: 1px solid #525252;
  border-radius: 6px;
  padding: 3px 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
  cursor: pointer;
}

.grand-pill.alert {
  background: var(--xo-red);
  border-color: #FF7A7F;
}

.gp-lbl {
  font-size: 9px;
  font-weight: 700;
  color: #9CA3AF;
  letter-spacing: 0.4px;
}

.grand-pill.alert .gp-lbl { color: #FFFFFF; }

.gp-val {
  font-size: 12.5px;
  font-weight: 700;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
}

.icon-action-btn {
  background: var(--xo-red);
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Narrow iPhone Portrait (<= 640px): Clean 2-tier top bar so Brand/Project/OFFLINE
   and [Dark] + [ESTIMATE | Files] never crowd or overlap! */
@media screen and (max-width: 640px) {
  #top-brand-bar {
    flex-wrap: wrap;
    row-gap: 6px;
    column-gap: 8px;
    padding-top: calc(var(--safe-top) + 6px);
    padding-bottom: 6px;
  }
  .brand-left {
    flex: 1 1 100%;
    width: 100%;
  }
  .brand-project-pill {
    max-width: none;
    flex: 0 1 auto;
    min-width: 0;
  }
  .offline-ready-dot {
    margin-left: auto;
  }
  .brand-right {
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-end;
    gap: 6px;
  }
  .dark-mode-btn {
    margin-right: 12px;
    padding: 4px 10px;
    font-size: 11.5px;
  }
}

/* --- Row 1 Horizontal Toolbar (Matches xBUDGET_v261202.xlsb) --- */
#row1-toolbar {
  background: var(--xo-dark);
  padding: 5px max(10px, calc(var(--safe-right) + 8px)) 5px max(10px, calc(var(--safe-left) + 8px));
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
  border-bottom: 2px solid #222222;
}
#row1-toolbar::-webkit-scrollbar { display: none; }

.tb-btn {
  background: #FFFFFF;
  color: #111111;
  border: 1px solid #646464;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 3px;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1.2;
}

.tb-btn.active {
  background: var(--xo-red);
  border-color: var(--xo-red-dark);
  color: #FFFFFF;
  font-weight: 700;
}

.tb-btn.pw-shortcut {
  border-left: 3px solid var(--xo-red);
  font-weight: 700;
}

.tb-btn.pm-mode-badge {
  background: var(--xo-red);
  border-color: var(--xo-red-dark);
  color: #FFFFFF;
  font-weight: 800;
}

.tb-btn.customize-right {
  margin-left: auto;
}

.tb-spacer {
  width: 6px;
  flex-shrink: 0;
}

/* --- Main Scrollable Sheet Area --- */
#sheet-viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px max(10px, calc(var(--safe-right) + 10px)) 20px max(10px, calc(var(--safe-left) + 10px));
}

.sheet-inner-container {
  max-width: 1480px;
  margin: 0 auto;
}

/* --- Sheet Top Header (Borderless Outer Frame) --- */
.sheet-banner {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 2px 8px;
  margin-bottom: 8px;
  box-shadow: none;
}

.sb-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid var(--xo-red);
  padding-bottom: 6px;
  margin-bottom: 5px;
}

.sb-logo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sb-logo-dark {
  height: 14px;
  width: auto;
}

.sb-year {
  font-size: 14px;
  font-weight: 700;
  color: #111111;
}

.sb-date {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sb-date-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #374151;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-align: right;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
}
.sb-date-btn:hover,
.sb-date-btn:focus {
  border-color: var(--xo-border);
  background: rgba(255, 255, 255, 0.75);
  outline: none;
}

.sb-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 700;
  color: #1F2937;
}

/* --- Collapsible Production Info Card on Cost Summary --- */
.info-card {
  background: var(--xo-card);
  border: 1px solid var(--xo-border);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}

.info-card-hdr {
  background: #E5E7EB;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
}

.info-grid > div {
  min-width: 0;
}

.info-field-row {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  margin-bottom: 5px;
}

.info-field-row label {
  width: 118px;
  font-size: 11.5px;
  font-weight: 600;
  color: #4B5563;
  flex-shrink: 0;
}

.info-field-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid #D1D5DB;
  border-radius: 5px;
  padding: 5px 7px;
  font-size: 16px; /* Prevents iOS zoom on focus */
  background: #F9FAFB;
  color: #111827;
}
.info-field-row input:focus {
  border-color: var(--xo-red);
  background: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(237, 28, 36, 0.2);
  outline: none;
}

/* --- Budget & Summary Tables --- */
.table-card {
  background: var(--xo-card);
  border: 1px solid var(--xo-border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.sec-super-bar {
  background: var(--xo-dark);
  color: #FFFFFF;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.sec-code-badge {
  background: var(--xo-red);
  color: #FFFFFF;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 11px;
  margin-right: 6px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.xb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

table.xb-table th {
  background: var(--xo-silver);
  color: #111111;
  font-weight: 700;
  padding: 6px 7px;
  border: 1px solid #9CA3AF;
  white-space: nowrap;
  text-align: center;
}

table.xb-table th.th-left { text-align: left; }
table.xb-table th.th-red { background: var(--xo-red-tint); }

table.xb-table td {
  padding: 6px 7px;
  border: 1px solid #E5E7EB;
  white-space: nowrap;
  vertical-align: middle;
}

table.xb-table tr.clickable-row { cursor: pointer; }
table.xb-table tr.clickable-row:active { background: #EBF3FC; }

td.sticky-title {
  position: sticky;
  left: 0;
  background: #FFFFFF;
  z-index: 2;
  max-width: var(--sticky-title-max);
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1.5px solid #D1D5DB !important;
}

tr.subtotal-row td {
  background: var(--xo-shaded);
  font-weight: 700;
  border-top: 1.5px solid #6B7280;
  border-bottom: 1.5px solid #6B7280;
}

tr.grand-row td {
  background: var(--xo-dark);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 13px;
}

tr.grand-row.alert td.alert-cell {
  background: var(--xo-red);
  color: #FFFFFF;
}

.txt-red-xo {
  color: var(--xo-red) !important;
  font-weight: 700;
}

.bg-shaded { background: var(--xo-shaded); }
.bg-red-tint { background: var(--xo-red-tint); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.ctr { text-align: center; }
.neg-red { color: var(--xo-red); font-weight: 600; }

/* Inline Direct Table Inputs (Shown on Landscape, iPad & Desktop Keyboard/Mouse) */
.wide-inline-only { display: none; }
.compact-cell-only { display: inline; }

@media screen and (hover: hover) and (pointer: fine) {
  .wide-inline-only { display: inline-block; }
  .compact-cell-only { display: none; }
}

.inline-num-input {
  width: 76px;
  border: 1px solid transparent;
  background: transparent;
  text-align: right;
  font-size: 16px;
  padding: 2px 4px;
  border-radius: 4px;
  color: #111827;
  font-variant-numeric: tabular-nums;
}
.inline-num-input:focus {
  border-color: var(--xo-red);
  background: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(237, 28, 36, 0.2);
  outline: none;
}

.inline-txt-input {
  width: 100%;
  min-width: 90px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 16px;
  padding: 2px 4px;
  border-radius: 4px;
  color: #111827;
}
.inline-txt-input:focus {
  border-color: var(--xo-red);
  background: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(237, 28, 36, 0.2);
  outline: none;
}

.inline-note-input {
  min-width: 92px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  padding: 3px 6px;
  border-radius: 4px;
  color: #1F2937;
  text-align: left;
  line-height: 1.25;
}
.inline-note-input:hover {
  border-color: #D1D5DB;
}
.inline-note-input:focus {
  border-color: var(--xo-red);
  background: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(237, 28, 36, 0.2);
  outline: none;
}

.inline-pct-input {
  width: 52px;
  border: 1px solid #D1D5DB;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  padding: 2px 3px;
  border-radius: 4px;
  color: #1F2937;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.inline-pct-input:hover {
  border-color: #9CA3AF;
}
.inline-pct-input:focus {
  border-color: var(--xo-red);
  background: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(237, 28, 36, 0.2);
  outline: none;
}

.fringe-cell-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 112px;
}

.fringe-amt-span {
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: #374151;
  font-size: 12px;
  white-space: nowrap;
  margin-left: auto;
}

.fringe-cell-print {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 72px;
}
.fringe-cell-print .fcp-pct {
  color: #4B5563;
  font-weight: 600;
}
.fringe-cell-print .fcp-amt {
  text-align: right;
  margin-left: auto;
}

.page-top-hint-bar {
  font-size: 11.5px;
  color: #4B5563;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pm-active-banner-row {
  margin-top: 6px;
}
.pm-active-badge-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--xo-red);
  border-radius: 6px;
  padding: 4px 12px;
  background: #FFF5F5;
  color: var(--xo-red);
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.pm-active-badge-box .rmb-dot {
  color: var(--xo-red);
  font-size: 10px;
}
.inline-del-ask {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--xo-red);
  white-space: nowrap;
  margin-right: 2px;
}

.running-mode-badge-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  border: 2px solid var(--xo-red);
  border-radius: 6px;
  padding: 5px 12px;
  background: #FFF5F5;
  color: var(--xo-red);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}
.running-mode-badge-box .rmb-dot {
  color: var(--xo-red);
  font-size: 10px;
}
.running-mode-badge-box .rmb-title {
  color: var(--xo-red);
  font-weight: 900;
}
.running-mode-badge-box .rmb-sub {
  color: #8F151A;
  font-weight: 700;
  font-size: 11px;
}

.fringe-rate-pill {
  background: #FFFFFF;
  color: #111827;
  border: 1px solid #9CA3AF;
  border-left: 3px solid var(--xo-red);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.fringe-rate-pill:hover {
  background: #F3F4F6;
}

th.th-fringe-link {
  cursor: pointer;
  text-decoration: underline dotted;
}

table.xb-table th.th-run-col {
  background: var(--xo-red-tint);
  color: #111827;
}

.log-add-rows-bar {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  border-top: 1px solid #E5E7EB;
}

.log-add-lbl {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}

.log-add-count-inp {
  width: 58px;
  padding: 6px 8px;
  border: 1px solid #9CA3AF;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  background: #FFFFFF;
  color: #111827;
}

.row-del-x {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #9CA3AF;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 5px;
  cursor: pointer;
}
.row-del-x:hover {
  color: var(--xo-red);
  border-color: #D1D5DB;
  background: #FEF2F2;
}

.row-drawer-btn {
  background: #F3F4F6;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  color: #374151;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  cursor: pointer;
}
.row-drawer-btn:active {
  background: var(--xo-active-blue);
}

/* --- Notes & Payment Terms Card --- */
.notes-card {
  background: var(--xo-card);
  border: 1px solid var(--xo-border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.notes-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.payment-banner {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #E5E7EB;
  color: var(--xo-red);
  font-size: 11.5px;
  font-weight: 700;
}

.copyright-foot {
  margin-top: 4px;
  font-size: 10px;
  color: #6B7280;
}

.xo-notes-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #D1D5DB;
  padding-bottom: 5px;
}
.xo-notes-body {
  font-size: 11.5px;
  color: #374151;
  margin-top: 6px;
}
.xo-notes-bullet {
  font-size: 11.5px;
  color: #1F2937;
}
.xo-contract-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background: #F9FAFB;
  border-top: 1px solid #E5E7EB;
  font-size: 11.5px;
  font-weight: 700;
}
.xo-muted-span { color: #4B5563; }
.xo-ln-num { color: #4B5563; font-weight: 700; }
.xo-ln-note { color: #6B7280; font-size: 11px; }
td.sticky-title.sticky-alert-tint { background: #FAD0D2; }
.xo-sec-title {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #111827;
}
.xo-subcard {
  background: #FFFFFF;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
}
.xo-subcard.active-proj {
  border-color: #ED1C24;
}

/* ============================================================================
 * TEAM SYNC (xDrive / Google Drive), PROJECT FOLDER LINK & PARTNER DIFF UI
 * ============================================================================ */
.team-sync-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px 10px;
  margin-bottom: 8px;
  background: #EDF2F7;
  border: 1px solid #CBD5E1;
  border-radius: 7px;
  font-size: 11px;
  color: #1F2937;
}
.tsb-left, .tsb-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tsb-dot {
  font-size: 10px;
  color: #10B981;
}
.tsb-dot.offline {
  color: #F59E0B;
}
.proj-shared-pill {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  border-radius: 999px;
  background: rgba(237, 28, 36, 0.14);
  color: #ED1C24;
  border: 1px solid rgba(237, 28, 36, 0.45);
  vertical-align: middle;
}
.proj-folder-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.12);
  color: #2563EB;
  border: 1px solid rgba(59, 130, 246, 0.35);
  cursor: pointer;
}
.proj-folder-pill:hover {
  background: rgba(59, 130, 246, 0.22);
}
.proj-diff-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  color: #B45309;
  border: 1px solid rgba(245, 158, 11, 0.55);
}
.proj-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  background: rgba(237, 28, 36, 0.16);
  color: #DC2626;
  border: 1px solid rgba(237, 28, 36, 0.55);
}
.bqd-item .proj-lock-pill {
  margin-left: 0;
  margin-top: 3px;
  background: rgba(237, 28, 36, 0.24);
  color: #FCA5A5;
  border-color: rgba(237, 28, 36, 0.65);
}
.partner-lock-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: #FEF2F2;
  border: 1.5px solid #ED1C24;
  border-left: 4px solid #ED1C24;
  border-radius: 7px;
  color: #991B1B;
  font-size: 12px;
  font-weight: 800;
}
.plb-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.plb-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.plb-btn {
  background: #FFFFFF;
  color: #B91C1C;
  border: 1px solid #ED1C24;
  border-radius: 5px;
  padding: 4px 9px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.plb-btn:hover {
  background: #FEE2E2;
}
.plb-btn.red {
  background: #ED1C24;
  border-color: #B8141A;
  color: #FFFFFF;
}

/* ============================================================================
 * PHASE 2: PM WORKSPACE, ★ ACTIVE PIN, ARCHIVE, ⚑ EP FLAGS, 📎 DOCS & PO STATUS
 * ============================================================================ */
.proj-star-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  color: #9CA3AF;
  vertical-align: middle;
}
.proj-star-btn:hover {
  color: #F59E0B;
}
.proj-star-btn.starred {
  color: #F59E0B;
}
.proj-active-shoot-pill {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.2);
  color: #B45309;
  border: 1px solid rgba(245, 158, 11, 0.6);
  vertical-align: middle;
}
.proj-pm-pill {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  font-size: 9.5px;
  font-weight: 800;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.45);
  vertical-align: middle;
}
.bqd-item .proj-active-shoot-pill {
  background: rgba(245, 158, 11, 0.25);
  color: #FCD34D;
  border-color: rgba(245, 158, 11, 0.65);
}
.bqd-item .proj-pm-pill {
  background: rgba(16, 185, 129, 0.22);
  color: #6EE7B7;
  border-color: rgba(16, 185, 129, 0.55);
}
.pm-frozen-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: #EFF6FF;
  border: 1.5px solid #3B82F6;
  border-left: 4px solid #2563EB;
  border-radius: 7px;
  color: #1E40AF;
  font-size: 12px;
  font-weight: 800;
}
.ep-flag-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px 12px;
  margin-bottom: 10px;
  background: #FFF7ED;
  border: 1.5px solid #F97316;
  border-left: 4px solid #EA580C;
  border-radius: 7px;
  color: #9A3412;
  font-size: 12px;
  font-weight: 700;
}
.ln-flag-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 3px;
  margin-right: 3px;
  font-size: 11px;
  color: #9CA3AF;
  opacity: 0.38;
  transition: opacity 0.12s ease, color 0.12s ease;
  vertical-align: middle;
}
tr:hover .ln-flag-btn,
.ln-flag-btn:focus {
  opacity: 0.95;
}
.ln-flag-btn.pending {
  opacity: 1;
  color: #EA580C;
  font-weight: 900;
}
.ln-flag-btn.approved {
  opacity: 1;
  color: #10B981;
  font-weight: 900;
}
.ln-flag-btn.changes {
  opacity: 1;
  color: #EF4444;
  font-weight: 900;
}
.po-status-pill {
  border-radius: 999px;
  padding: 2px 8px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid #D1D5DB;
  background: #F3F4F6;
  color: #4B5563;
  white-space: nowrap;
}
.po-status-pill.invoiced {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.5);
  color: #1D4ED8;
}
.po-status-pill.paid {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.55);
  color: #047857;
}
.doc-attach-btn {
  background: transparent;
  border: 1px solid #D1D5DB;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  color: #6B7280;
  white-space: nowrap;
}
.doc-attach-btn.attached {
  background: rgba(59, 130, 246, 0.14);
  border-color: #3B82F6;
  color: #1D4ED8;
  font-weight: 800;
}
.pm-portal-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #111318;
  color: #F9FAFB;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.pm-portal-card {
  width: 100%;
  max-width: 430px;
  background: #1B1F27;
  border: 1px solid #343B48;
  border-top: 3px solid var(--xo-red);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}
.bqd-item .proj-shared-pill {
  background: rgba(237, 28, 36, 0.22);
  color: #FF8A90;
  border-color: rgba(237, 28, 36, 0.55);
}
.bqd-item .proj-diff-pill {
  margin-left: 0;
  margin-top: 3px;
  background: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
  border-color: rgba(245, 158, 11, 0.55);
}
.share-toggle-btn {
  padding: 4px 9px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}
.folder-link-btn {
  padding: 4px 7px !important;
  font-size: 11px !important;
}
.folder-link-btn.linked {
  border-color: #3B82F6 !important;
  background: rgba(59, 130, 246, 0.12) !important;
  color: #1D4ED8 !important;
}
.partner-diff-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px 12px;
  margin-bottom: 10px;
  background: #FFFBEB;
  border: 1.5px solid #F59E0B;
  border-left: 4px solid #D97706;
  border-radius: 7px;
  color: #92400E;
  font-size: 12px;
  font-weight: 700;
}
.pdb-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.pdb-dot {
  color: #D97706;
  font-size: 11px;
}
.pdb-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pdb-btn {
  background: #FFFFFF;
  color: #92400E;
  border: 1px solid #F59E0B;
  border-radius: 5px;
  padding: 4px 9px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.pdb-btn:hover {
  background: #FEF3C7;
}
.pdb-btn.solid {
  background: #D97706;
  border-color: #B45309;
  color: #FFFFFF;
}
.pdb-btn.solid:hover {
  background: #B45309;
}
.tab-partner-dot {
  display: inline-block;
  margin-left: 5px;
  color: #FBBF24;
  font-size: 9px;
  vertical-align: middle;
}
.sheet-tab-pill.active .tab-partner-dot {
  color: #D97706;
}
.hdr-partner-dot {
  color: #FBBF24;
  margin-right: 4px;
  font-size: 10px;
}
#app-shell .partner-changed-input {
  background: rgba(245, 158, 11, 0.16) !important;
  border: 1.5px solid #D97706 !important;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.22);
}
#app-shell tr.partner-changed-row > td:first-child {
  box-shadow: inset 3.5px 0 0 #F59E0B;
}
#app-shell tr.partner-changed-row > td {
  background-image: linear-gradient(rgba(245, 158, 11, 0.06), rgba(245, 158, 11, 0.06));
}
.partner-cs-dot {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  background: rgba(245, 158, 11, 0.2);
  color: #B45309;
  border: 1px solid rgba(245, 158, 11, 0.5);
}
.partner-cell-tooltip {
  position: fixed;
  z-index: 900;
  background: #1C1917;
  color: #FEF3C7;
  border: 1px solid #F59E0B;
  border-left: 3px solid #FBBF24;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  max-width: min(400px, calc(100vw - 16px));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.diff-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  margin-bottom: 5px;
  border-radius: 6px;
  border: 1px solid #E5E7EB;
  background: #FFFFFF;
  cursor: pointer;
}
.diff-summary-row:hover {
  border-color: #F59E0B;
  background: #FFFBEB;
}
.dsr-vals {
  font-size: 11.5px;
  font-weight: 800;
  color: #B45309;
  white-space: nowrap;
}

/* ============================================================================
 * EXECUTIVE STUDIO DARK MODE (On-Screen Only — Print & PDF Always Stay White!)
 * ============================================================================ */
html.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) body:not(.pdf-capture-mode):not(.browser-print-active) {
  background: #121417;
  color: #F3F4F6;
  color-scheme: dark;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell {
  background: #14161A;
  color: #F3F4F6;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #top-brand-bar {
  background: #0E1013;
  border-bottom-color: #2A2F38;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #row1-toolbar {
  background: #181B20;
  border-bottom-color: #2A2F38;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .tb-btn {
  background: #252932;
  color: #E5E7EB;
  border-color: #3D4452;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .tb-btn.active {
  background: var(--xo-red);
  color: #FFFFFF;
  border-color: #FF6B72;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .tb-btn.pw-shortcut {
  border-left: 3px solid #F87171;
  color: #FFFFFF;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .sb-top {
  border-bottom-color: var(--xo-red);
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .sb-year,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .sb-sub {
  color: #F3F4F6;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .sb-date,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .sb-date-btn {
  color: #D1D5DB;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .sb-date-btn:hover,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .sb-date-btn:focus {
  background: #252932;
  border-color: #4B5563;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .info-card,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .table-card,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .notes-card {
  background: #1D2026;
  border-color: #343A46;
  color: #F3F4F6;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .info-card-hdr {
  background: #262A33;
  color: #F3F4F6;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .info-card-hdr span:last-child {
  color: #9CA3AF !important;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .info-field-row label {
  color: #9CA3AF;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .info-field-row input {
  background: #14171C;
  border-color: #373E4B;
  color: #F9FAFB;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .sec-super-bar {
  background: #111317;
  border-bottom: 1px solid #2E3440;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell table.xb-table th {
  background: #282D37;
  color: #F3F4F6;
  border-color: #3B4250;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell table.xb-table th.th-red {
  background: #4C1D24;
  color: #FECACA;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell table.xb-table td {
  background: #1D2026;
  color: #E5E7EB;
  border-color: #2C313C;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell table.xb-table tr.clickable-row:active {
  background: #263449;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell td.sticky-title {
  background: #1D2026;
  border-right-color: #3B4250 !important;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell td.sticky-title.sticky-alert-tint,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .bg-red-tint,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell table.xb-table tr.bg-red-tint td {
  background: #451A20;
  color: #FECACA;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .bg-shaded,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell tr.subtotal-row td {
  background: #252932;
  color: #F9FAFB;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell tr.subtotal-row td {
  border-top-color: #4B5563;
  border-bottom-color: #4B5563;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell tr.grand-row td {
  background: #0E1014;
  color: #FFFFFF;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell tr.grand-row.alert td.alert-cell {
  background: var(--xo-red);
  color: #FFFFFF;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .inline-num-input,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .inline-txt-input,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .inline-note-input,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .inline-pct-input {
  color: #F9FAFB;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .inline-pct-input {
  background: #14171C;
  border-color: #373E4B;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .fringe-amt-span,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .page-top-hint-bar {
  color: #D1D5DB;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .fringe-rate-pill {
  background: #252932;
  color: #F9FAFB;
  border-color: #454C5B;
  border-left: 3px solid #F87171;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .tb-btn.pm-mode-badge {
  background: var(--xo-red);
  border-color: var(--xo-red-dark);
  color: #FFFFFF;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .pm-active-badge-box {
  background: rgba(237, 28, 36, 0.16);
  border-color: var(--xo-red);
  color: #FF6B72;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .pm-active-badge-box .rmb-dot {
  color: #FF6B72;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .inline-del-ask {
  color: #FF6B72;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .running-mode-badge-box {
  background: rgba(237, 28, 36, 0.16);
  border-color: var(--xo-red);
  color: #FFFFFF;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .running-mode-badge-box .rmb-dot,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .running-mode-badge-box .rmb-title {
  color: #FF6B72;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .running-mode-badge-box .rmb-sub {
  color: #F3F4F6;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell table.xb-table th.th-run-col {
  background: #4C1D24;
  color: #FECACA;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .log-add-rows-bar {
  border-top-color: #2E3440;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .log-add-lbl {
  color: #D1D5DB;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .log-add-count-inp {
  background: #14171C;
  border-color: #3E4553;
  color: #F9FAFB;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .inline-note-input:hover,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .inline-pct-input:hover {
  border-color: #454C5B;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .info-field-row input:focus,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .inline-num-input:focus,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .inline-txt-input:focus,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .inline-note-input:focus,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .inline-pct-input:focus {
  background: #121519;
  border-color: #F87171;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.25);
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .xo-contract-bar {
  background: #171A1F;
  border-top-color: #2E3440;
  color: #F3F4F6;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .xo-notes-hdr {
  border-bottom-color: #343A46;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .xo-notes-body,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .xo-notes-bullet {
  color: #D1D5DB;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .payment-banner {
  border-top-color: #343A46;
  color: #F87171;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .copyright-foot,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .xo-muted-span,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .xo-ln-num,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .xo-ln-note {
  color: #9CA3AF;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #bottom-sheet-tabs {
  background: #0E1013;
  border-top-color: #2A2F38;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .sheet-tab-pill {
  background: #1F232B;
  color: #D1D5DB;
  border-color: #373E4B;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .sheet-tab-pill.active {
  background: #F3F4F6;
  color: #111827;
  border-color: #F3F4F6;
}

/* Dark Mode Modals */
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .modal-backdrop {
  background: rgba(0, 0, 0, 0.72);
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .modal-card {
  background: #1B1E24;
  color: #F3F4F6;
  border: 1px solid #343A46;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .mc-hdr {
  background: #111317;
  border-bottom: 1px solid #2E3440;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .mc-tab-btn {
  background: #252932;
  color: #D1D5DB;
  border-color: #3D4452;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .mc-tab-btn.active {
  background: #243E63;
  color: #FFFFFF;
  border-color: #63B3ED;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .mc-field label,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .xo-sec-title {
  color: #E5E7EB;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .mc-field input,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .mc-field select,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .mc-field textarea,
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .modal-card input[type="text"],
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .modal-card input[type="date"],
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .modal-card textarea {
  background: #121519;
  color: #F9FAFB;
  border-color: #3E4553 !important;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .mc-btn {
  background: #282D37;
  color: #F3F4F6;
  border-color: #454C5B;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .mc-btn.primary {
  background: #374151;
  border-color: #4B5563;
  color: #FFFFFF;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .mc-btn.red {
  background: var(--xo-red);
  border-color: var(--xo-red-dark);
  color: #FFFFFF;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .mc-btn.active-opt {
  background: #243E63;
  border-color: #63B3ED;
  color: #FFFFFF;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .mc-status-banner {
  background: #242831;
  border-color: #3B4250;
  color: #E5E7EB;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .mc-status-banner.active {
  background: #1E3554;
  border-color: #63B3ED;
  color: #F3F4F6;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .mc-status-banner.pm-prompt-banner {
  background: rgba(237, 28, 36, 0.15);
  border: 1.5px solid var(--xo-red);
  color: #F3F4F6;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .xo-subcard {
  background: #232730;
  border-color: #3B4250;
  color: #F3F4F6;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .xo-subcard.active-proj {
  border-color: #ED1C24;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .team-sync-bar {
  background: #161A22;
  border-color: #323946;
  color: #E5E7EB;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .proj-shared-pill {
  background: rgba(237, 28, 36, 0.22);
  color: #FF8A90;
  border-color: rgba(237, 28, 36, 0.55);
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .proj-folder-pill {
  background: rgba(59, 130, 246, 0.2);
  color: #93C5FD;
  border-color: rgba(96, 165, 250, 0.45);
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .proj-diff-pill {
  background: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
  border-color: rgba(245, 158, 11, 0.55);
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .proj-lock-pill {
  background: rgba(237, 28, 36, 0.24);
  color: #FCA5A5;
  border-color: rgba(237, 28, 36, 0.65);
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .partner-lock-banner {
  background: rgba(237, 28, 36, 0.17);
  border-color: #ED1C24;
  border-left-color: #FF6B72;
  color: #FECACA;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .plb-btn {
  background: #252932;
  color: #FECACA;
  border-color: rgba(237, 28, 36, 0.7);
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .plb-btn:hover {
  background: #323743;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .plb-btn.red {
  background: #ED1C24;
  border-color: #FF6B72;
  color: #FFFFFF;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .proj-active-shoot-pill {
  background: rgba(245, 158, 11, 0.22);
  color: #FCD34D;
  border-color: rgba(251, 191, 36, 0.6);
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .proj-pm-pill {
  background: rgba(16, 185, 129, 0.22);
  color: #6EE7B7;
  border-color: rgba(16, 185, 129, 0.55);
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .pm-frozen-banner {
  background: rgba(37, 99, 235, 0.16);
  border-color: #3B82F6;
  border-left-color: #60A5FA;
  color: #BFDBFE;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .ep-flag-banner {
  background: rgba(249, 115, 22, 0.16);
  border-color: #F97316;
  border-left-color: #FB923C;
  color: #FED7AA;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .po-status-pill {
  background: #252932;
  border-color: #3E4553;
  color: #D1D5DB;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .po-status-pill.invoiced {
  background: rgba(59, 130, 246, 0.22);
  border-color: #60A5FA;
  color: #93C5FD;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .po-status-pill.paid {
  background: rgba(16, 185, 129, 0.22);
  border-color: #34D399;
  color: #6EE7B7;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .doc-attach-btn {
  border-color: #3E4553;
  color: #9CA3AF;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .doc-attach-btn.attached {
  background: rgba(59, 130, 246, 0.22);
  border-color: #60A5FA;
  color: #93C5FD;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .folder-link-btn.linked {
  border-color: #60A5FA !important;
  background: rgba(59, 130, 246, 0.2) !important;
  color: #BFDBFE !important;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .partner-diff-banner {
  background: rgba(245, 158, 11, 0.14);
  border-color: #F59E0B;
  border-left-color: #FBBF24;
  color: #FDE68A;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .pdb-dot {
  color: #FBBF24;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .pdb-btn {
  background: #252932;
  color: #FDE68A;
  border-color: rgba(245, 158, 11, 0.6);
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .pdb-btn:hover {
  background: #323743;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .pdb-btn.solid {
  background: #D97706;
  border-color: #F59E0B;
  color: #FFFFFF;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .partner-changed-input {
  background: rgba(245, 158, 11, 0.22) !important;
  border: 1.5px solid #FBBF24 !important;
  color: #FFFBEB !important;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) #app-shell .partner-cs-dot {
  background: rgba(245, 158, 11, 0.22);
  color: #FCD34D;
  border-color: rgba(251, 191, 36, 0.55);
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .diff-summary-row {
  background: #232730;
  border-color: #3B4250;
  color: #F3F4F6;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .diff-summary-row:hover {
  border-color: #F59E0B;
  background: rgba(245, 158, 11, 0.14);
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .dsr-vals {
  color: #FCD34D;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .modal-card table.xb-table th {
  background: #282D37;
  color: #F3F4F6;
  border-color: #3B4250;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .modal-card table.xb-table td {
  background: #1D2026;
  color: #E5E7EB;
  border-color: #2C313C;
}

.sheet-footer-logo {
  display: flex;
  justify-content: center;
  padding: 12px 0 6px;
  opacity: 0.85;
}
.sheet-footer-logo img {
  height: 10px;
  width: auto;
}

/* --- Bottom Sticky 16-Tab iOS / iPadOS Switcher --- */
#bottom-sheet-tabs {
  background: var(--xo-dark-2);
  padding: 6px max(10px, calc(var(--safe-right) + 8px)) calc(var(--safe-bottom) + 6px) max(10px, calc(var(--safe-left) + 8px));
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-top: 1px solid #444444;
  flex-shrink: 0;
}
#bottom-sheet-tabs::-webkit-scrollbar { display: none; }

.sheet-tab-pill {
  background: #383838;
  color: #D1D5DB;
  border: 1px solid #525252;
  border-radius: 6px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.sheet-tab-pill.active {
  background: #FFFFFF;
  color: #111111;
  border-color: #FFFFFF;
  font-weight: 800;
  box-shadow: 0 -2px 0 var(--xo-red) inset;
}

/* --- Floating Modals & iOS Bottom Sheet Drawer --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

.modal-card {
  background: #F5F6F8;
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.28);
  padding-bottom: var(--safe-bottom);
}

.mc-hdr {
  background: var(--xo-dark);
  color: #FFFFFF;
  padding: 11px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.mc-close {
  background: #555555;
  color: #FFFFFF;
  border: 1px solid #777777;
  border-radius: 5px;
  width: 28px;
  height: 26px;
  font-weight: 700;
  cursor: pointer;
}

.mc-body {
  padding: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

.mc-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 12px;
}

.mc-tabs.mc-tabs-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media screen and (max-width: 480px) {
  .mc-tabs.mc-tabs-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.mc-tab-btn {
  padding: 7px 4px;
  background: #FFFFFF;
  border: 1px solid #9CA3AF;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.mc-tab-btn.active {
  background: var(--xo-active-blue);
  border-color: var(--xo-active-border);
  font-weight: 700;
}

.mc-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 9px;
}
.mc-field.full { grid-column: 1 / -1; }

.mc-field label {
  font-size: 11.5px;
  font-weight: 700;
  color: #374151;
}

.mc-field input, .mc-field select, .mc-field textarea {
  padding: 8px 10px;
  border: 1px solid #9CA3AF;
  border-radius: 6px;
  font-size: 16px;
  background: #FFFFFF;
  color: #111827;
}

.mc-btn-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
  flex-wrap: wrap;
}

.mc-btn {
  padding: 9px 14px;
  border-radius: 6px;
  border: 1px solid #828282;
  background: #FFFFFF;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.mc-btn.primary {
  background: var(--xo-dark);
  border-color: #222222;
  color: #FFFFFF;
}

.mc-btn.red {
  background: var(--xo-red);
  border-color: var(--xo-red-dark);
  color: #FFFFFF;
}

.mc-btn.active-opt {
  background: var(--xo-active-blue);
  border-color: var(--xo-active-border);
}

.mc-status-banner {
  background: #E9ECF2;
  border: 1px solid #C3C8D0;
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
}
.mc-status-banner.active {
  background: var(--xo-active-blue);
  border-color: var(--xo-active-border);
}
.mc-status-banner.pm-prompt-banner {
  background: #FFF5F5;
  border: 1.5px solid var(--xo-red);
  color: #111827;
}

/* ============================================================================
 * RESPONSIVE TIER 1: iPhone Landscape (Short Height <= 500px, Rotated Phone)
 * Compacts vertical chrome so maximum budget rows stay visible in landscape!
 * ============================================================================ */
@media screen and (orientation: landscape) and (max-height: 520px) {
  :root {
    --sticky-title-max: 245px;
  }
  #top-brand-bar {
    padding-top: max(4px, var(--safe-top));
    padding-bottom: 4px;
  }
  .brand-project-pill {
    max-width: 240px;
  }
  #row1-toolbar {
    padding-top: 3px;
    padding-bottom: 3px;
  }
  .tb-btn {
    padding: 3px 9px;
    font-size: 11.5px;
  }
  #sheet-viewport {
    padding-top: 6px;
    padding-bottom: 10px;
  }
  .sheet-banner {
    padding: 2px 2px 6px;
    margin-bottom: 6px;
  }
  #bottom-sheet-tabs {
    padding-top: 4px;
    padding-bottom: max(4px, calc(var(--safe-bottom) * 0.6));
  }
  .sheet-tab-pill {
    padding: 4px 10px;
    font-size: 11.5px;
  }
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wide-inline-only { display: inline-block; }
  .compact-cell-only { display: none; }

  /* Center & widen modal card so it fits comfortably inside 390px landscape height */
  .modal-backdrop {
    align-items: center;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .modal-card {
    max-width: 660px;
    max-height: 94dvh;
    border-radius: 10px;
    padding-bottom: 0;
  }
  .mc-hdr {
    padding: 7px 12px;
  }
  .mc-body {
    padding: 10px 14px;
  }
  .mc-field-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .mc-field {
    margin-bottom: 5px;
  }
  .mc-field input, .mc-field select {
    padding: 5px 8px;
  }
}

/* ============================================================================
 * RESPONSIVE TIER 2: iPad Portrait / Split View (Width >= 700px, Height > 520px)
 * Spacious tablet grid, inline editing + drawer button, centered floating modals
 * ============================================================================ */
@media screen and (min-width: 700px) and (min-height: 521px) {
  :root {
    --sticky-title-max: 290px;
  }
  #top-brand-bar {
    padding-top: calc(var(--safe-top) + 8px);
    padding-bottom: 8px;
    padding-left: max(18px, calc(var(--safe-left) + 14px));
    padding-right: max(18px, calc(var(--safe-right) + 14px));
  }
  .brand-wordmark {
    height: 15px;
  }
  .brand-year {
    font-size: 13.5px;
  }
  .brand-project-pill {
    max-width: 280px;
    font-size: 12.5px;
    padding: 4px 10px;
  }
  .gp-val {
    font-size: 14px;
  }
  .dark-mode-btn {
    margin-right: 18px;
    padding: 6px 12px;
    font-size: 12.5px;
  }
  #row1-toolbar {
    padding: 6px max(18px, calc(var(--safe-right) + 14px)) 6px max(18px, calc(var(--safe-left) + 14px));
    gap: 6px;
  }
  .tb-btn {
    padding: 6px 12px;
    font-size: 12.5px;
  }
  #sheet-viewport {
    padding: 14px max(18px, calc(var(--safe-right) + 14px)) 28px max(18px, calc(var(--safe-left) + 14px));
  }
  .sb-logo-dark {
    height: 16px;
  }
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 14px 16px;
  }
  table.xb-table {
    font-size: 13px;
  }
  table.xb-table th,
  table.xb-table td {
    padding: 7px 9px;
  }
  .wide-inline-only { display: inline-block; }
  .compact-cell-only { display: none; }

  .modal-backdrop {
    align-items: center;
  }
  .modal-card {
    max-width: 640px;
    max-height: 85dvh;
    border-radius: 12px;
    padding-bottom: 0;
  }
}

/* ============================================================================
 * RESPONSIVE TIER 3: iPad Landscape / iPad Pro / Desktop (Width >= 1024px)
 * Full 4-column executive header, wide AICP line titles, desktop-grade density
 * ============================================================================ */
@media screen and (min-width: 1024px) {
  :root {
    --sticky-title-max: 360px;
  }
  .brand-project-pill {
    max-width: 380px;
  }
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
  }
  .modal-card {
    max-width: 720px;
  }
  .inline-pct-input {
    font-size: 13px;
    width: 50px;
  }
}

@media screen and (min-width: 1400px) {
  .info-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
}

/* ============================================================================
 * 1-Page-Per-Tab Exact Uniform-Margin Print & Vector PDF Engine
 * Physical Sheet: 8.50in x 11.00in (612pt x 792pt)
 * Uniform 4-Side Margins: Left = Right = Top = Bottom = 0.40in (28.8pt)
 * Printable Inner Box: 7.70in x 10.20in (739.2px x 979.2px @ 96dpi)
 * ============================================================================ */

#print-package-root.print-measuring {
  display: block !important;
  position: fixed !important;
  left: -20000px !important;
  top: 0 !important;
  width: 8.5in !important;
  background: #FFFFFF !important;
  z-index: -1 !important;
  pointer-events: none !important;
}

body.pdf-capture-mode,
html.pdf-capture-mode {
  width: 8.5in !important;
  height: auto !important;
  overflow: visible !important;
  background: #FFFFFF !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.pdf-capture-mode #app-shell,
body.pdf-capture-mode .no-print {
  display: none !important;
}
body.pdf-capture-mode #print-package-root {
  display: block !important;
  width: 8.5in !important;
  margin: 0 !important;
  padding: 0 !important;
}

.print-sheet-page {
  width: 8.5in;
  height: 11in;
  padding: 0.4in;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #FFFFFF;
  color: #000000;
  overflow: hidden;
  position: relative;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  page-break-after: always;
  break-after: page;
  page-break-inside: avoid;
  break-inside: avoid;
}

.print-sheet-page:last-child {
  page-break-after: auto;
  break-after: auto;
}

.print-scale-box {
  width: 7.7in;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.print-scale-inner {
  width: 7.7in;
  transform-origin: top left;
}

.print-sheet-page .wide-inline-only { display: none !important; }
.print-sheet-page .compact-cell-only { display: inline !important; }
.print-sheet-page .table-scroll { overflow: visible !important; }
.print-sheet-page td.sticky-title {
  position: static !important;
  max-width: none !important;
}
.print-sheet-page .sheet-banner {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 0 5px !important;
  margin-bottom: 6px !important;
}
.print-sheet-page .table-card,
.print-sheet-page .notes-card,
.print-sheet-page .print-info-card {
  border-radius: 0 !important;
  box-shadow: none !important;
  margin-bottom: 6px !important;
  border: 1px solid #6B7280 !important;
  overflow: visible !important;
}
.print-sheet-page table.xb-table {
  font-size: 7.5pt !important;
}
.print-sheet-page table.xb-table th,
.print-sheet-page table.xb-table td {
  padding: 2.5pt 4pt !important;
}

.print-info-card {
  background: #FFFFFF;
  padding: 6px 10px;
}
.print-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  font-size: 7.2pt;
  line-height: 1.32;
}
.print-info-grid > div {
  min-width: 0;
}
.print-info-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  border-bottom: 0.5px solid #E5E7EB;
  padding: 1.5px 0;
}
.print-info-row .pi-lbl {
  font-weight: 700;
  color: #374151;
  white-space: nowrap;
  flex-shrink: 0;
}
.print-info-row .pi-val {
  color: #111827;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  overflow-wrap: anywhere;
  flex: 1;
  min-width: 0;
}
.print-sheet-page td.print-note-wrap {
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 210px;
  text-align: left;
}

.print-footer-center {
  width: 7.7in;
  height: 14pt;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
}
.print-footer-center img {
  width: 56.85pt;
  height: 7.5pt;
  display: block;
}

/* Browser / iOS AirPrint Pre-Decoded Raster Mode (Eliminates Blank Pages on iOS) */
html.browser-print-active,
body.browser-print-active {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  background: #FFFFFF !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.browser-print-active #app-shell,
body.browser-print-active .no-print {
  display: none !important;
}
body.browser-print-active #print-package-root {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #FFFFFF !important;
}

.print-raster-page {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  background: #FFFFFF;
  page-break-after: always;
  break-after: page;
  page-break-inside: avoid;
  break-inside: avoid;
}
.print-raster-page:last-child {
  page-break-after: auto !important;
  break-after: auto !important;
}
.print-raster-page img {
  display: block;
  width: 100%;
  max-width: 8.5in;
  max-height: 10.85in;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}
body.ios-airprint-mode .print-raster-page img {
  /* iOS AirPrint ignores @page margin:0 and enforces ~0.45in hardware margins,
     leaving ~9.6in printable height. Keeping max-height <= 9.25in guarantees
     1 sheet = 1 physical page with ZERO blank spillover pages! */
  max-width: 100%;
  max-height: 9.25in;
}

@media print {
  @page {
    size: 8.5in 11in;
    margin: 0 !important;
  }
  html, body {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #FFFFFF !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .no-print { display: none !important; }
  .only-print {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .print-sheet-page:last-child {
    height: 10.98in;
  }
}

/* --- v261205.1: Partial PM Lock Styling & Clean PM Share Invite Card --- */
.info-field-row input.pm-locked-field:disabled {
  background: rgba(0, 0, 0, 0.035);
  color: #6B7280;
  cursor: not-allowed;
  border-bottom-style: dashed;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .info-field-row input.pm-locked-field:disabled {
  background: rgba(255, 255, 255, 0.03);
  color: #9CA3AF;
}
.pm-invite-preview-box {
  background: #F9FAFB;
  border: 1px solid #D1D5DB;
  border-radius: 7px;
  padding: 9px 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  color: #111827;
  margin-bottom: 9px;
  word-break: break-all;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .pm-invite-preview-box {
  background: #12151B;
  border-color: #363D4B;
  color: #F3F4F6;
}
.pm-status-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 800;
  color: #059669;
}
.pm-status-badge-frozen {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 800;
  color: #2563EB;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .pm-status-badge-live {
  color: #34D399;
}
body.dark-mode:not(.pdf-capture-mode):not(.browser-print-active) .pm-status-badge-frozen {
  color: #60A5FA;
}
