/* New Creation Owner Portal, Client Proposal Room & Printable Construction Sheets
 * Private Architectural Command Vault: Obsidian Lacquer + Champagne Brass Foil + Archival Paper
 */
body.portal-body {
  background: #060b11;
  color: #f3eee4;
  min-height: 100dvh;
  margin: 0;
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.portal-body [hidden] {
  display: none !important;
}

.portal-kpi-strip,
.portal-view-pane,
.client-3d-panel,
.doc-preview-column {
  padding: 0;
}

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 45;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.75rem;
  background: rgba(5, 10, 16, 0.96);
  border-bottom: 1px solid rgba(223, 192, 130, 0.24);
  backdrop-filter: blur(12px);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.portal-brand img {
  width: 54px;
  height: 44px;
  object-fit: contain;
}

.portal-brand-text strong {
  display: block;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 400;
  color: #f7f2e8;
  line-height: 1.05;
}

.portal-brand-text span {
  display: block;
  font-size: 0.67rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #dfc082;
  margin-top: 0.15rem;
}

.portal-top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.portal-mode-pill {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.38);
  color: #bae6fd;
}

.portal-btn {
  appearance: none;
  border: 1px solid rgba(223, 192, 130, 0.42);
  background: rgba(223, 192, 130, 0.1);
  color: #f6e7c5;
  border-radius: 999px;
  min-height: 40px;
  padding: 0.48rem 1rem;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background 0.18s, border-color 0.18s, transform 0.16s;
}

.portal-btn:hover {
  background: rgba(223, 192, 130, 0.22);
  border-color: #e5c689;
}

.portal-btn-gold {
  background: linear-gradient(135deg, #e5c688, #c79f56);
  border-color: #e5c688;
  color: #07131e;
}

.portal-btn-gold:hover {
  background: linear-gradient(135deg, #efd49d, #d3ac63);
  color: #07131e;
}

.portal-btn-cyan {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(125, 211, 252, 0.5);
  color: #e0f2fe;
}

.portal-btn-cyan:hover {
  background: rgba(56, 189, 248, 0.28);
}

/* Auth Seal Gate */
.portal-auth-gate {
  max-width: 480px;
  margin: 5rem auto;
  padding: 2.2rem;
  background: linear-gradient(180deg, #0d1826 0%, #070f18 100%);
  border: 1px solid rgba(223, 192, 130, 0.35);
  border-radius: 18px;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.5);
}

.portal-auth-gate h1 {
  font-size: 2.4rem;
  color: #f8f3ea;
  margin-bottom: 0.5rem;
}

.portal-auth-gate p {
  color: #b8c5d2;
  font-size: 0.9rem;
}

.portal-auth-medallion {
  display: flex;
  justify-content: center;
  margin-bottom: 0.9rem;
}

/* KPI Command Strip */
.portal-kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: rgba(223, 192, 130, 0.16);
  border-bottom: 1px solid rgba(223, 192, 130, 0.2);
}

.portal-kpi {
  background: #08111b;
  padding: 0.95rem 1.35rem;
}

.portal-kpi span {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #93a5b7;
}

.portal-kpi strong {
  display: block;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 400;
  color: #f8f3ea;
  line-height: 1.1;
  margin-top: 0.2rem;
}

/* Main Portal Grid */
.portal-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: calc(100dvh - 140px);
}

.portal-rail {
  background: #070f18;
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-rail-search {
  display: grid;
  gap: 0.5rem;
}

.portal-input,
.portal-select,
.portal-textarea {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.75rem;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #0b1623;
  color: #f4efe6;
  font: inherit;
  font-size: 0.82rem;
}

.portal-textarea {
  min-height: 92px;
  resize: vertical;
}

.portal-project-list {
  display: grid;
  gap: 0.5rem;
  overflow-y: auto;
  max-height: calc(100dvh - 280px);
  padding-right: 0.2rem;
}

.portal-proj-card {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.025);
  color: #e9e3d8;
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
}

.portal-proj-card:hover {
  border-color: rgba(223, 192, 130, 0.45);
}

.portal-proj-card.is-selected {
  background: rgba(223, 192, 130, 0.13);
  border-color: #dfc082;
}

.portal-proj-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.portal-proj-top strong {
  font-size: 0.88rem;
  color: #fff;
}

.portal-proj-loc {
  display: block;
  font-size: 0.74rem;
  color: #9db0c2;
  margin-top: 0.15rem;
}

.portal-proj-spec {
  display: block;
  font-size: 0.72rem;
  color: #dfc082;
  margin-top: 0.25rem;
}

.portal-proj-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.portal-badge {
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #d6e0ea;
}

.portal-badge-gold {
  background: rgba(223, 192, 130, 0.2);
  color: #f7e4bc;
}

.portal-badge-green {
  background: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
}

.portal-badge-cyan {
  background: rgba(56, 189, 248, 0.2);
  color: #bae6fd;
}

/* Workspace Main Column */
.portal-stage {
  padding: 1.35rem 1.75rem 3rem;
  min-width: 0;
}

.portal-proj-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
}

.portal-proj-header h1 {
  font-size: clamp(1.9rem, 3vw, 2.65rem);
  color: #f9f5ed;
  margin: 0;
}

.portal-proj-sub {
  font-size: 0.82rem;
  color: #a6b7c7;
  margin: 0.25rem 0 0;
}

.portal-status-toast {
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: rgba(223, 192, 130, 0.14);
  border: 1px solid rgba(223, 192, 130, 0.42);
  color: #f8e8c6;
  font-size: 0.81rem;
  margin-bottom: 1rem;
}

.portal-status-toast[hidden] {
  display: none;
}

.portal-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.portal-view-tab {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0a1420;
  color: #b7c6d4;
  border-radius: 999px;
  padding: 0.55rem 1.05rem;
  font: inherit;
  font-size: 0.77rem;
  font-weight: 700;
  cursor: pointer;
}

.portal-view-tab[aria-selected="true"] {
  background: linear-gradient(135deg, #e5c688, #c79f56);
  border-color: #e5c688;
  color: #07131e;
}

.portal-view-pane[hidden] {
  display: none;
}

/* Split Editor + Document Sheet Preview */
.portal-split {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}

.portal-card {
  background: linear-gradient(180deg, #0c1724 0%, #08101a 100%);
  border: 1px solid rgba(223, 192, 130, 0.24);
  border-radius: 15px;
  padding: 1.15rem;
}

.portal-card + .portal-card {
  margin-top: 1rem;
}

.portal-card h2,
.portal-card h3 {
  font-size: 1.35rem;
  color: #f7f2e8;
  margin: 0 0 0.5rem;
}

.portal-card p {
  font-size: 0.8rem;
  color: #a4b5c5;
}

.portal-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.portal-field-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.portal-field label {
  font-size: 0.71rem;
  font-weight: 700;
  color: #cfdbe6;
}

.portal-shell input[type="checkbox"],
.client-portal-shell input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 0;
  flex: 0 0 18px;
  accent-color: #d4b170;
  cursor: pointer;
}

.portal-field label:has(input[type="checkbox"]),
.client-portal-shell label:has(input[type="checkbox"]) {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  line-height: 1.35;
}

.portal-details-group {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.7rem;
  background: rgba(255, 255, 255, 0.02);
}

.portal-details-group summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 750;
  color: #e6c88d;
  letter-spacing: 0.04em;
}

.portal-details-body {
  margin-top: 0.75rem;
}

.portal-doc-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.portal-doc-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.portal-doc-row.is-active {
  border-color: #dfc082;
  background: rgba(223, 192, 130, 0.12);
}

.portal-doc-row strong {
  display: block;
  font-size: 0.82rem;
  color: #fff;
}

.portal-doc-row small {
  display: block;
  font-size: 0.71rem;
  color: #9cb0c3;
}

.portal-share-box {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 0.85rem;
}

/* Modal Dialog for Walk-In Client Creation */
.portal-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(3, 7, 12, 0.82);
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.portal-modal-backdrop[hidden] {
  display: none;
}

.portal-modal {
  width: min(560px, 100%);
  background: #0b1623;
  border: 1px solid rgba(223, 192, 130, 0.42);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.6);
}

/* Client Proposal & E-Signature Room (/portal/client) */
.client-room-wrap {
  width: min(1220px, calc(100% - 36px));
  margin: 0 auto;
  padding: 1.75rem 0 4rem;
}

.client-hero-card {
  background: linear-gradient(145deg, #0b1725, #071019);
  border: 1px solid rgba(223, 192, 130, 0.32);
  border-radius: 18px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
}

.client-hero-card h1 {
  font-size: clamp(2rem, 3.8vw, 3rem);
  color: #f9f4eb;
  margin: 0.2rem 0 0.35rem;
}

.client-3d-panel {
  margin-bottom: 1.75rem;
}

.client-3d-host {
  height: 440px;
  position: relative;
  background: #050b12;
}

.client-sign-panel {
  background: linear-gradient(180deg, #0d1928 0%, #08111b 100%);
  border: 1px solid rgba(223, 192, 130, 0.42);
  border-radius: 18px;
  padding: 1.6rem;
  margin-top: 1.75rem;
}

.sig-pad-wrap {
  background: #fdfbf7;
  border: 2px solid #c9a86a;
  border-radius: 12px;
  overflow: hidden;
  margin: 0.65rem 0;
}

.sig-pad-canvas {
  display: block;
  width: 100%;
  height: 165px;
  cursor: crosshair;
  touch-action: none;
}

.client-exec-seal {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  color: #d1fae5;
}

.client-exec-seal-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.35rem;
}

/* Client Milestone Draw & Lyon Financial Explorer Strip */
.client-finance-strip {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.client-draws-panel,
.client-lyon-panel {
  background: linear-gradient(160deg, #0b1725 0%, #071019 100%);
  border: 1px solid rgba(223, 192, 130, 0.3);
  border-radius: 16px;
  padding: 1.2rem 1.35rem;
}

.client-draws-panel h3,
.client-lyon-panel h3 {
  font-size: 1.45rem;
  color: #f8f3ea;
  margin: 0.15rem 0 0.7rem;
}

.client-draws-mini {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.client-draw-pill {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(223, 192, 130, 0.25);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
}

.client-draw-pill span {
  display: block;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #dfc082;
}

.client-draw-pill strong {
  display: block;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.22rem;
  font-weight: 400;
  color: #fff;
  margin-top: 0.12rem;
}

/* Tab 5: Schedule, Milestone Draws & Audit Trail */
.portal-schedule-stack {
  display: grid;
  gap: 1.3rem;
}

.portal-fin-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0.85rem 0 1rem;
}

.portal-fin-cell {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(223, 192, 130, 0.24);
  border-radius: 11px;
  padding: 0.75rem 0.95rem;
}

.portal-fin-cell.is-emerald {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(52, 211, 153, 0.42);
}

.portal-fin-cell span {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9bb0c3;
}

.portal-fin-cell strong {
  display: block;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 400;
  color: #f8f3ea;
  margin-top: 0.15rem;
}

.portal-draw-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.portal-draw-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.portal-draw-card.is-paid {
  background: rgba(16, 185, 129, 0.09);
  border-color: rgba(52, 211, 153, 0.45);
}

.portal-draw-card.is-issued {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(125, 211, 252, 0.4);
}

.portal-draw-kicker {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #e4c486;
}

.portal-draw-amount {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: #fff;
}

.portal-draw-card p {
  font-size: 0.72rem;
  color: #9cb0c3;
  margin: 0 0 0.35rem;
  flex: 1;
}

.portal-milestone-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.portal-ms-card {
  border-radius: 11px;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.portal-ms-card.is-done {
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(16, 185, 129, 0.08);
}

.portal-ms-card.is-current {
  border-color: #e4c486;
  background: rgba(223, 192, 130, 0.12);
}

.portal-ms-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.64rem;
  font-weight: 800;
  color: #dfc082;
}

.portal-ms-card strong {
  font-size: 0.8rem;
  color: #f7f2e8;
}

.portal-ms-card small {
  font-size: 0.69rem;
  color: #9bb0c3;
}

.portal-audit-list {
  display: grid;
  gap: 0.45rem;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 0.75rem;
}

.portal-audit-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.7rem;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.portal-audit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e4c486;
  flex-shrink: 0;
}

.portal-audit-row strong {
  display: block;
  font-size: 0.76rem;
  color: #f3eee4;
  text-transform: capitalize;
}

.portal-audit-row small {
  display: block;
  font-size: 0.67rem;
  color: #91a4b7;
}

/* Printable Official Construction Sheets (.doc-sheet) */
.doc-preview-column {
  display: grid;
  gap: 1.35rem;
}

.doc-sheet {
  background: #fcfaf5;
  color: #142329;
  border: 1px solid #d5cab4;
  border-radius: 6px;
  padding: 1.65rem 1.85rem;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
  font-size: 0.78rem;
  line-height: 1.45;
}

.doc-masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px solid #0b2230;
  margin-bottom: 0.9rem;
}

.doc-brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.doc-crest {
  width: 64px;
  height: 52px;
  object-fit: contain;
}

.doc-company-name {
  display: block;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 400;
  color: #071923;
  line-height: 1.05;
}

.doc-company-meta {
  display: block;
  font-size: 0.69rem;
  color: #4b5d63;
  margin-top: 0.2rem;
}

.doc-badge-col {
  text-align: right;
}

.doc-type-pill {
  display: inline-block;
  background: #071923;
  color: #ebd5a7;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 0.26rem 0.6rem;
  border-radius: 4px;
}

.doc-page-num {
  display: block;
  font-size: 0.68rem;
  color: #5b6b70;
  margin-top: 0.25rem;
  font-weight: 700;
}

.doc-block {
  margin-bottom: 0.8rem;
  border: 1px solid #dfd7c7;
  background: #fffefb;
  padding: 0.65rem 0.8rem;
  border-radius: 4px;
}

.doc-sec-title {
  font-family: Manrope, sans-serif;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #0b2230;
  border-bottom: 1px solid #e6dfd0;
  padding-bottom: 0.3rem;
  margin: 0 0 0.5rem;
}

.doc-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.doc-kv-grid {
  display: grid;
  gap: 0.45rem 0.75rem;
}

.doc-kv-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.doc-kv-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.doc-kv-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.doc-kv-k {
  display: block;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #607075;
}

.doc-kv-v {
  display: block;
  font-size: 0.77rem;
  color: #0e2026;
  font-weight: 700;
}

.doc-check-wrap,
.doc-finish-matrix {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}

.doc-finish-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.28rem 0.5rem;
}

.doc-chk {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.71rem;
  color: #495a60;
}

.doc-chk.is-checked {
  color: #071923;
  font-weight: 750;
}

.doc-chk-box {
  width: 14px;
  height: 14px;
  border: 1px solid #7d8b90;
  border-radius: 2px;
  display: inline-grid;
  place-items: center;
  font-size: 0.64rem;
  font-weight: 900;
  background: #fff;
  color: #071923;
}

.doc-chk.is-checked .doc-chk-box {
  background: #071923;
  border-color: #071923;
  color: #ebd5a7;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.73rem;
}

.doc-table th,
.doc-table td {
  border-bottom: 1px solid #e5decb;
  padding: 0.34rem 0.45rem;
  text-align: left;
}

.doc-table th {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #55656a;
  background: #f5f0e4;
}

.doc-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: #0b2230;
}

.doc-total-row td {
  font-weight: 800;
  font-size: 0.84rem;
  background: #f3ebd9;
  color: #071923;
}

.doc-warranty-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.doc-war-cell {
  border: 1px solid #e2d9c5;
  background: #f8f4ea;
  padding: 0.38rem 0.5rem;
  border-radius: 3px;
}

.doc-war-cell strong {
  display: block;
  font-size: 0.74rem;
  color: #071923;
}

.doc-war-cell span {
  display: block;
  font-size: 0.66rem;
  color: #4f6066;
}

.doc-draws-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.doc-draw-box {
  border: 1px solid #d5c5a3;
  background: #f9f4e8;
  padding: 0.45rem 0.55rem;
  border-radius: 4px;
}

.doc-draw-pct {
  display: block;
  font-size: 0.63rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #7c5d26;
}

.doc-draw-amt {
  display: block;
  font-size: 0.84rem;
  color: #071923;
  margin: 0.1rem 0;
}

.doc-draw-box small {
  display: block;
  font-size: 0.63rem;
  color: #4e5e64;
  line-height: 1.3;
}

.doc-note {
  font-size: 0.69rem;
  color: #48585e;
  margin: 0.4rem 0 0;
}

.doc-legal-copy {
  font-size: 0.62rem;
  line-height: 1.38;
  color: #223339;
  text-align: justify;
  margin: 0;
}

.doc-accept-notes {
  margin: 0 0 0.55rem;
  padding-left: 1.1rem;
  font-size: 0.68rem;
  color: #35474d;
}

.doc-sig-wrap {
  display: grid;
  gap: 0.6rem;
}

.doc-sig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.doc-embossed-seal {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid #bfa065;
  background: linear-gradient(90deg, #faf4e4 0%, #fffdf8 100%);
  border-radius: 5px;
}

.doc-embossed-seal.is-executed {
  border-color: #166534;
  background: linear-gradient(90deg, #f0fdf4 0%, #faf6ea 100%);
}

.doc-seal-svg {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.doc-embossed-copy strong {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #071923;
}

.doc-embossed-copy span {
  display: block;
  font-size: 0.65rem;
  color: #3f5157;
  margin-top: 0.15rem;
}

.doc-sig-box {
  border: 1px solid #cbbba0;
  background: #fdfbf6;
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
}

.doc-sig-title {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: #5b6b70;
  margin-bottom: 0.35rem;
}

.doc-sig-img {
  height: 54px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin: 0.15rem 0;
}

.doc-sig-script {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 1.55rem;
  color: #0b2545;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.doc-sig-placeholder {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 0.71rem;
  color: #829196;
  border-bottom: 1px dashed #b9c2c5;
  margin-bottom: 0.3rem;
}

.doc-sig-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.66rem;
  color: #35464c;
  padding-top: 0.25rem;
  border-top: 1px solid #e4dccb;
}

.doc-hash-foot {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.6rem;
  color: #5f7075;
  margin: 0.45rem 0 0;
  word-break: break-all;
}

.doc-exhibit-img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid #0b2230;
}

.doc-exhibit-placeholder {
  padding: 2rem;
  background: #f2ece0;
  border: 1px dashed #a8997c;
  text-align: center;
  color: #4a5a60;
  font-size: 0.78rem;
}

@media (max-width: 1180px) {
  .portal-shell,
  .portal-split,
  .client-finance-strip {
    grid-template-columns: 1fr;
  }
  .portal-project-list {
    max-height: 240px;
  }
  .portal-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .portal-draw-cards,
  .portal-fin-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .portal-milestone-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .portal-kpi-strip,
  .doc-two-col,
  .doc-kv-grid-3,
  .doc-kv-grid-4,
  .doc-finish-matrix,
  .doc-draws-grid,
  .doc-sig-grid,
  .portal-field-grid,
  .portal-field-grid-3,
  .portal-draw-cards,
  .portal-fin-summary,
  .portal-milestone-grid,
  .client-draws-mini {
    grid-template-columns: 1fr;
  }
}

@media print {
  body.portal-body {
    background: #fff;
    color: #000;
  }
  .no-print,
  .preview-banner,
  .portal-topbar,
  .portal-kpi-strip,
  .portal-rail,
  .portal-proj-header,
  .portal-view-tabs,
  .portal-editor-col,
  .client-hero-card,
  .client-3d-panel,
  .client-finance-strip,
  .client-sign-panel {
    display: none !important;
  }
  .portal-shell,
  .portal-split,
  .portal-stage,
  .client-room-wrap {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .doc-sheet {
    box-shadow: none !important;
    border: 0 !important;
    padding: 0.2in !important;
    break-after: page;
    page-break-after: always;
  }
  .doc-sheet:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}

/* Conflict notice: a save or action was refused because the record changed. */
.portal-conflict {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-color: rgba(240, 128, 96, 0.6);
  background: rgba(240, 128, 96, 0.12);
}

.portal-conflict[hidden] {
  display: none;
}

.portal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#draw-payment-form[hidden],
#draw-payment-history[hidden],
#doc-action-note[hidden],
#contract-lock-note[hidden],
#client-sign-blocked[hidden],
#client-3d-frozen-note[hidden] {
  display: none;
}

/* owner sign-in and email log */
.portal-hint{margin:8px 0 0;font-size:.85rem;opacity:.8}
.portal-email-log{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:6px;font-size:.88rem}
.portal-email-log li{padding:8px 10px;border-radius:8px;background:rgba(235,212,162,.08);border:1px solid rgba(235,212,162,.18)}
.portal-email-log li.is-failed{border-color:rgba(220,90,70,.6);background:rgba(220,90,70,.1)}

/* phones: a compact header that scrolls away, actions in one swipeable row */
@media (max-width: 760px) {
  .portal-topbar { position: static; padding: 0.7rem 1rem; gap: 0.6rem; }
  .portal-brand .nccew-medallion-host, .portal-brand-text span { display: none; }
  .portal-brand img { width: 42px; height: auto; }
  .portal-brand-text strong { font-size: 1.15rem; line-height: 1.15; }
  .portal-topbar .portal-top-actions { width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 0.5rem; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .portal-topbar .portal-top-actions > * { flex: none; white-space: nowrap; }
  /* action rows inside cards wrap, and long buttons may break onto two lines */
  .portal-card .portal-top-actions, .client-hero-card .portal-top-actions { flex-wrap: wrap; }
  .portal-card .portal-btn, .client-hero-card .portal-btn { white-space: normal; max-width: 100%; }
}
.portal-check{display:flex;align-items:center;gap:.55rem;margin-top:.6rem;font-size:.9rem;cursor:pointer}
.portal-check input{width:20px;height:20px;accent-color:#c8a25c}

/* narrow screens: grid columns may shrink below their widest content, so nothing is cut off */
.portal-card, .portal-field, .portal-split > *, .portal-stage, .portal-view-pane { min-width: 0; }
.portal-select { max-width: 100%; text-overflow: ellipsis; }
@media (max-width: 1180px) {
  .portal-shell, .portal-split, .client-finance-strip { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .doc-two-col, .doc-kv-grid-3, .doc-kv-grid-4, .doc-finish-matrix, .doc-draws-grid, .doc-sig-grid,
  .portal-field-grid, .portal-field-grid-3, .portal-draw-cards, .portal-fin-summary, .portal-milestone-grid,
  .client-draws-mini { grid-template-columns: minmax(0, 1fr); }
  /* six stats in a 2 x 3 block instead of six full-width rows */
  .portal-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 16px text stops iPhone Safari zooming in on every field tap */
  .portal-input, .portal-select, .portal-textarea { font-size: 16px; }
}
@media (max-width: 720px) {
  /* contract pages: narrower margins on phones; wide tables scroll inside the page instead of being cut off */
  .portal-stage { padding-left: 16px; padding-right: 16px; }
  .doc-sheet { padding: 18px 16px; overflow-wrap: anywhere; }
  .doc-sheet table { display: block; max-width: 100%; overflow-x: auto; }
  .doc-preview-column { overflow-x: auto; }
}

/* ---- Sign-in note, action strip, all-documents center (2026-11-23) ---------------- */
.portal-auth-foot {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(223, 192, 130, 0.18);
  font-size: 0.78rem !important;
  color: #9fb0c1 !important;
}
.portal-auth-foot strong { color: #f6e7c5; }

.portal-action-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.75rem;
  background:
    linear-gradient(180deg, rgba(223, 192, 130, 0.07), rgba(223, 192, 130, 0) 70%),
    #07101a;
  border-bottom: 1px solid rgba(223, 192, 130, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 236, 196, 0.08);
}
.portal-action-title {
  margin: 0 0.4rem 0 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.25rem;
  color: #f8f3ea;
}
.portal-action-chip {
  appearance: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  color: #cfdbe6;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 3px rgba(6, 11, 17, 0.9), inset 0 0 0 4px rgba(223, 192, 130, 0.12);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.18s, background 0.18s;
  animation: portal-deal 0.42s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
.portal-action-chip:nth-child(3) { animation-delay: 0.05s; }
.portal-action-chip:nth-child(4) { animation-delay: 0.1s; }
.portal-action-chip:nth-child(5) { animation-delay: 0.15s; }
.portal-action-chip strong {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1;
}
.portal-action-chip:hover { transform: translateY(-1px); border-color: #e5c689; }
.portal-action-chip.is-gold {
  color: #07131e;
  background: linear-gradient(135deg, #f1d9a4 0%, #d6b070 48%, #b88a43 100%);
  border-color: #efd49d;
}
.portal-action-chip.is-cyan { color: #e0f2fe; background: rgba(56, 189, 248, 0.16); border-color: rgba(125, 211, 252, 0.5); }
.portal-action-chip.is-clear { opacity: 0.72; }
@keyframes portal-deal {
  from { opacity: 0; transform: translateY(8px) rotate(-1.5deg) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.portal-doc-center {
  margin: 1rem 1.75rem 0;
  padding: 1.15rem 1.25rem 1.25rem;
  background: linear-gradient(180deg, #0c1724 0%, #08101a 100%);
  border: 1px solid rgba(223, 192, 130, 0.32);
  border-radius: 16px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 236, 196, 0.1), inset 0 0 0 4px #08101a, inset 0 0 0 5px rgba(223, 192, 130, 0.12);
}
.portal-dc-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}
.portal-dc-head h2 { margin: 0; font-size: 1.7rem; color: #f8f3ea; }
.portal-dc-head .eyebrow { margin: 0 0 0.2rem; }
.portal-dc-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.portal-dc-filters .portal-input { min-width: 220px; }
.portal-dc-list { display: grid; gap: 0.5rem; }
.portal-dc-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.025);
}
.portal-dc-row.is-countersign { border-color: rgba(229, 198, 137, 0.6); background: rgba(223, 192, 130, 0.08); }
.portal-dc-row.is-send, .portal-dc-row.is-fix { border-color: rgba(125, 211, 252, 0.35); }
.portal-dc-main { min-width: 0; }
.portal-dc-main strong { display: block; color: #fff; font-size: 0.86rem; overflow-wrap: anywhere; }
.portal-dc-main small { display: block; color: #93a5b7; font-size: 0.72rem; margin-top: 0.15rem; overflow-wrap: anywhere; }
.portal-dc-type {
  display: inline-block;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e6c88d;
  margin-bottom: 0.15rem;
}
.portal-dc-state { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.portal-dc-next { font-size: 0.72rem; color: #f6e7c5; font-weight: 700; }
.portal-dc-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }
.portal-dc-empty {
  display: grid;
  gap: 0.25rem;
  padding: 1.4rem;
  text-align: center;
  border: 1px dashed rgba(223, 192, 130, 0.3);
  border-radius: 12px;
  color: #a4b5c5;
  font-size: 0.82rem;
}
.portal-dc-empty strong { color: #f8f3ea; font-family: "Instrument Serif", Georgia, serif; font-size: 1.3rem; font-weight: 400; }

.portal-rail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.2rem 0 0.6rem;
  font-size: 0.74rem;
  color: #a4b5c5;
  cursor: pointer;
}
.portal-rail-toggle input { width: 18px; height: 18px; accent-color: #d4b170; }

.portal-badge-practice { background: rgba(167, 139, 250, 0.2); color: #ddd6fe; }
.portal-practice-banner {
  margin: 0 0 0.9rem;
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.1);
  color: #e9e4ff;
  font-size: 0.8rem;
  line-height: 1.5;
}
.portal-practice-choice {
  margin: 0.4rem 0 0.9rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 11px;
  background: rgba(167, 139, 250, 0.07);
}
.portal-practice-choice label { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 0.82rem; cursor: pointer; }
.portal-practice-choice input { width: 18px; height: 18px; accent-color: #a78bfa; }
.portal-practice-choice p { margin: 0.35rem 0 0; }

.portal-startup-list {
  display: grid;
  gap: 0.45rem;
  margin: 0.4rem 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
.portal-startup-list legend { padding: 0 0.35rem; font-size: 0.71rem; font-weight: 700; color: #cfdbe6; }
.portal-startup-list label { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 0.78rem; color: #dfe7ee; cursor: pointer; line-height: 1.35; }
.portal-startup-list input { width: 18px; height: 18px; flex: 0 0 18px; accent-color: #d4b170; }
.portal-field-label { font-size: 0.71rem; font-weight: 700; color: #cfdbe6; }
.portal-punch-list { display: grid; gap: 0.45rem; margin: 0.35rem 0 0.5rem; }
.portal-punch-list:empty::before {
  content: "No open items. Add any that remain after the walkthrough.";
  font-size: 0.74rem;
  color: #93a5b7;
}
.portal-punch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 150px auto;
  gap: 0.4rem;
  align-items: center;
  animation: portal-deal 0.32s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@media (max-width: 760px) {
  .portal-action-strip { padding: 0.75rem 1rem; }
  .portal-action-title { width: 100%; }
  .portal-doc-center { margin: 0.75rem 0.75rem 0; padding: 1rem; }
  .portal-dc-filters, .portal-dc-filters .portal-input, .portal-dc-filters .portal-select { width: 100%; min-width: 0; }
  .portal-dc-row { grid-template-columns: minmax(0, 1fr); }
  .portal-dc-actions { justify-content: flex-start; }
  .portal-punch-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .portal-punch-row > input[data-punch="item"] { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-action-chip, .portal-punch-row { animation: none; }
  .portal-action-chip { transition: none; }
}
.portal-doc-center, .portal-ledger-card, .portal-view-pane { scroll-margin-top: 150px; }
.portal-ledger-card > p { margin-top: 0; }
#btn-cmp-add-punch { align-self: flex-start; }
/* Tall forms on short screens: the dialog scrolls inside the window. */
.portal-modal { max-height: calc(100dvh - 2.5rem); overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 560px) {
  .portal-modal { padding: 1.1rem; }
  .portal-modal .portal-field-grid { grid-template-columns: 1fr; }
}
/* The signed banner holds a 64-character fingerprint; let the text column shrink and wrap on phones. */
.client-exec-seal-row > div { min-width: 0; }
#signed-banner-title, #signed-banner-detail { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .client-exec-seal-row { flex-direction: column; align-items: flex-start; }
}

/* Georgia statutory lien waiver: the statute requires at least 12 point type for the form. */
.doc-statutory .lw-form { font-size: 16px; line-height: 1.6; color: #0f1b26; letter-spacing: 0.005em; }
.doc-statutory .lw-form p { margin: 0 0 0.85em; font-size: 16px; text-align: justify; }
.doc-statutory .lw-title { text-align: center; font-size: 17px; font-weight: 800; letter-spacing: 0.04em; margin: 0.4em 0 1em; line-height: 1.45; }
.doc-statutory .lw-line { text-align: left !important; margin-bottom: 0.2em !important; font-weight: 700; }
.doc-statutory .lw-fill { text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
.doc-statutory .lw-blank { display: inline-block; min-width: 7em; border-bottom: 1.5px solid currentColor; }
.doc-statutory .lw-property { border-bottom: 1.5px solid currentColor; padding-bottom: 0.3em; }
.doc-statutory .lw-sign { display: grid; gap: 0.9em; justify-items: end; margin: 1.6em 0 1em; }
.doc-statutory .lw-sign-right { display: flex; align-items: flex-end; gap: 0.5em; }
.doc-statutory .lw-rule { display: inline-block; min-width: 15em; border-bottom: 1.5px solid currentColor; }
.doc-statutory .lw-rule-named { font-size: 16px; padding-top: 1.6em; text-align: center; }
.doc-statutory .lw-witness { display: grid; grid-template-columns: auto; justify-items: start; gap: 0.15em; margin: 0.5em 0 1.4em; }
.doc-statutory .lw-witness .lw-rule { margin-top: 1.5em; }
.doc-statutory .lw-notice { font-weight: 800; border: 2px solid currentColor; padding: 0.75em 0.9em; }
@media print {
  .doc-statutory .lw-form, .doc-statutory .lw-form p, .doc-statutory .lw-rule-named { font-size: 12pt !important; }
  .doc-statutory .lw-title { font-size: 13pt !important; }
}
@media (max-width: 560px) {
  .doc-statutory .lw-rule { min-width: 10em; }
  .doc-statutory .lw-form p { text-align: left; }
}
