/* v2.77.0: quality profile accountability / cumulative exclusion ledger */
/* v2.77.0: cumulative quality automation / CI guardrails */
/* v2.76.0: estimate PDF / estimate wizard / deal form PC layout balance */
/* v2.76.0: mobile global navigation drawer hardening */
/* v2.76.0: mobile form overflow and checkbox layout hardening */
/* v2.75.39: payables timeline and AP deep-link hardening */
/* v2.75.46: estimate PDF / estimate wizard / deal form PC layout balance */
/* v2.75.46: mobile global navigation drawer hardening */
/* v2.75.46: mobile form overflow and checkbox layout hardening */
/* v2.75.35: estimate PDF / estimate wizard / deal form PC layout balance */
/* v2.65 UAT UX fixes compatibility marker */
/* v2.65.1 KAI UI layout hardening compatibility marker */
/* v2.65 screen-level visual polish compatibility marker */
/* v2.59 dedicated mobile cards compatibility marker */
/* v2.59 deal detail mobile tabs compatibility marker */
/* v2.59 mobile UAT checklist compatibility marker */
/* v2.58 mobile UAT checklist */
/* v2.58 deal detail mobile tabs */
/* v2.58 dedicated mobile cards */
/* v2.57 mobile UAT checklist */
/* v2.57 deal detail mobile tabs */
/* v2.57 dedicated mobile cards */
/* v2.56 mobile UAT checklist */
/* v2.56 deal detail mobile tabs */
/* v2.56 dedicated mobile cards */
/* v2.56 mobile action menu and mobile card title */
/* v2.55 deal detail mobile tabs */
/* v2.55 dedicated mobile cards */
/* v2.55 mobile action menu and mobile card refinements */
/* v2.54 deal detail mobile tabs compatibility marker */
/* v2.54 dedicated mobile cards compatibility marker */
/* v2.54 mobile action menu and mobile card refinements compatibility marker */
/* v2.54 mobile list cards and action ergonomics compatibility marker */
/* v2.53 dedicated mobile cards compatibility marker */
/* v2.53 mobile action menu and mobile card refinements compatibility marker */
/* v2.53 mobile list cards and action ergonomics compatibility marker */
/* v2.53 screen-level visual polish compatibility marker */
/* v2.52 global visual polish */
/* v2.52 screen-level visual polish */
/* v2.52 mobile list cards and action ergonomics */
/* v2.52 mobile action menu and mobile card refinements */
/* v2.50 screen-level visual polish */
/* v2.50 global visual polish */
/* v2.50 pilot UAT feedback ticket management */
/* v2.50 pilot UAT progress */
/* v2.49 global visual polish */
/* v2.49 pilot UAT feedback ticket management */
/* v2.49 pilot UAT progress */
/* v2.49 UAT UX fixes */
/* v2.48 UAT UX fixes compatibility marker */
/* v2.48 pilot smoke checklist compatibility marker */
/* v2.48 pilot UAT progress compatibility marker */
/* v2.48 pilot UAT feedback ticket management compatibility marker */
/* v2.47 UAT UX fixes */
/* v2.47 pilot smoke checklist */
/* v2.47 limited pilot user membership tools */
/* v2.47 pilot UAT progress */
/* v2.46 UAT UX fixes */
/* v2.46 pilot smoke checklist */
/* v2.46 limited pilot user membership tools */
/* v2.46 limited multi-tenant pilot */
/* v2.45 tenant support executive dashboard compatibility marker */
/* v2.45 limited multi-tenant pilot compatibility marker */
/* v2.45 limited pilot user membership tools compatibility marker */
/* v2.45 pilot smoke checklist compatibility marker */
/* v2.44 limited pilot user membership tools compatibility marker */
/* v2.44 limited multi-tenant pilot compatibility marker */
/* v2.44 tenant support executive dashboard compatibility marker */
/* v2.43 limited multi-tenant pilot compatibility marker */
/* v2.43 tenant support executive dashboard compatibility marker */
/* v2.43 tenant support timeline compatibility marker */
/* v2.42 tenant support timeline compatibility marker */
/* v2.42 tenant support executive dashboard compatibility marker */
/* v2.21 executive reporting visual refresh */
:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #059669;
  --warning: #d97706;
  --primary: #2563eb;
  --color-primary: var(--primary);
  --color-success: var(--success);
  --color-warning: var(--warning);
  --color-danger: var(--danger);
  --color-border: #e5e7eb;
  --color-surface: #ffffff;
  --color-surface-muted: #f7f9fb;
  --border-color: var(--color-border);
  --surface: var(--color-surface);
  --surface-muted: var(--color-surface-muted);
  --muted-color: var(--muted);
  --surface-color: var(--surface);
  --muted-surface: var(--surface-muted);
  --muted-text: var(--muted-color);
  --border: var(--line);
  --bp-mobile: 640px;
  --bp-tablet: 900px;
  --bp-laptop: 1200px;
  --bp-desktop: 1600px;
  --topbar-height: 64px;
  --z-dropdown: 300;
  --z-sticky: 200;
  --z-modal: 2100;
  --z-modal-content: 2110;
  --z-toast: 2200;
  --z-tooltip: 3000;
}

* { box-sizing: border-box; }
:root { line-height: 1.5; -webkit-text-size-adjust: 100%; }
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #111827;
  color: #fff;
  padding: 0.9rem 1.4rem;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}
.brand { font-weight: 700; }
.topbar nav {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.topbar a { color: #fff; opacity: 0.92; }

.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.5rem auto 4rem;
}

.hero {
  background: linear-gradient(135deg, #ffffff, #eff6ff);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.hero h1 { margin-top: 0; }

.grid { display: grid; gap: 1rem; }
.cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1.5rem; }
.cards .card { min-width: 0; overflow-wrap: anywhere; }
.card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.04);
}
.card { display: block; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.card h2, .panel h2 { margin-top: 0; }
.card p, .muted { color: var(--muted); }
.panel { margin-bottom: 1.2rem; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1rem;
}
.form-grid > .full,
.form-grid > .form-grid-full { grid-column: 1 / -1; }
label { display: grid; gap: 0.35rem; font-size: 0.92rem; font-weight: 600; }
input, select, textarea, button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: 0.65rem 0.75rem;
}
textarea { min-height: 80px; }
button {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}
button:hover { background: var(--accent-dark); }
button.secondary { background: #f3f4f6; color: var(--text); border-color: #d1d5db; }
button.danger { background: var(--danger); border-color: var(--danger); }
button.success { background: #059669; border-color: #059669; color: #fff; }
button.success:hover { background: #047857; }

.table-wrap { overflow-x: auto; overflow-y: visible; scroll-behavior: smooth; }
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
th, td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 0.7rem;
  vertical-align: top;
}
th { background: #f9fafb; font-size: 0.86rem; color: #374151; }
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.82rem;
  font-weight: 700;
}
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
pre {
  white-space: pre-wrap;
  background: #111827;
  color: #e5e7eb;
  padding: 1rem;
  border-radius: 12px;
  overflow-x: auto;
}
.error {
  color: var(--danger);
  font-weight: 700;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.kpi {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  background: #fbfdff;
}
.kpi .label { color: var(--muted); font-size: 0.85rem; }
.kpi .value { font-size: 1.35rem; font-weight: 800; margin-top: 0.3rem; }
.kpi .note { color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }
.badge.high { background: #fee2e2; color: #991b1b; }
.badge.medium { background: #fef3c7; color: #92400e; }
.badge.low { background: #ecfeff; color: #155e75; }

/* v0.8 UI/UX improvements */
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.page-heading h1 { margin: 0.2rem 0 0.35rem; }
.breadcrumb { color: var(--muted); margin: 0; font-size: 0.9rem; }
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.section-head h2 { margin-bottom: 0.2rem; }
.toolbar {
  display: flex;
  align-items: end;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 0.8rem 0 1rem;
  padding: 0.8rem;
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.toolbar label { min-width: 180px; }
.checkline {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 0.45rem;
  min-width: auto !important;
  padding-bottom: 0.62rem;
}
.checkline input { width: auto; }
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 0.65rem 0.85rem;
  font-weight: 800;
}
.button-link:hover { text-decoration: none; background: var(--accent-dark); }
.button-link.secondary { background: #f3f4f6; color: var(--text); border-color: #d1d5db; }
.strong-link { font-weight: 800; color: #111827; }
.subtext { color: var(--muted); font-size: 0.82rem; margin-top: 0.18rem; }
.subtext.inline { margin-left: 0.35rem; display: inline-block; }
.badge.success { background: #dcfce7; color: #166534; }
.badge.warning { background: #fef3c7; color: #92400e; }
.badge.info { background: #dbeafe; color: #1e40af; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.badge.muted, .badge.muted-badge { background: #f3f4f6; color: #4b5563; }
.detail-heading {
  background: linear-gradient(135deg, #ffffff, #eef2ff);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.4rem;
}
.meta-row, .heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.action-list { display: grid; gap: 0.75rem; }
.action-card {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 14px;
  padding: 0.85rem;
  background: #fff;
}
.action-card.high { border-left-color: #dc2626; }
.action-card.medium { border-left-color: #f59e0b; }
.action-card.low { border-left-color: #0891b2; }
.action-card h3 { margin: 0.45rem 0 0.25rem; font-size: 1rem; }
.action-card p { margin: 0; color: var(--muted); }
.action-meta { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.84rem; }
.definition-list {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0.55rem 0.8rem;
  margin: 0;
}
.definition-list dt { color: var(--muted); font-weight: 700; }
.definition-list dd { margin: 0; word-break: break-word; }
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.timeline-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0.8rem;
  position: relative;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.timeline-item::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  position: absolute;
  left: -5px;
  top: 1.15rem;
}
.timeline-item.success::before { background: #16a34a; }
.timeline-item.warning::before { background: #f59e0b; }
.timeline-item.info::before { background: #2563eb; }
.timeline-date { color: var(--muted); font-weight: 800; font-size: 0.9rem; }
.timeline-title { font-weight: 800; }
.timeline-meta { color: var(--muted); margin-top: 0.25rem; }
.tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tab-button {
  background: #f3f4f6;
  color: var(--text);
  border-color: #d1d5db;
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
}
.tab-button span {
  display: inline-grid;
  place-items: center;
  min-width: 1.5rem;
  border-radius: 999px;
  padding: 0.08rem 0.35rem;
  background: #fff;
  color: var(--muted);
  font-size: 0.8rem;
}
.tab-button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab-button.active span { color: var(--accent); }
.record-table-placeholder { min-height: 80px; }
.skeleton-block { min-height: 160px; }

@media (max-width: 820px) {
  .page-heading, .section-head { display: grid; }
  .detail-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; }
  .definition-list { grid-template-columns: 1fr; }
}

/* v0.9 review workflow */
.compact-actions { gap: 0.35rem; }
.compact-actions button { padding: 0.42rem 0.55rem; font-size: 0.82rem; }
.review-memo {
  margin-top: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-left: 3px solid #c7d2fe;
  background: #f8fafc;
  color: var(--muted);
  border-radius: 8px;
}

/* v1.0-v1.1 document workflow + freee preflight */
.document-flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  align-items: start;
}
.mini-form {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  background: #fbfdff;
  display: grid;
  gap: 0.75rem;
}
.mini-form-head h3 {
  margin: 0 0 0.25rem;
}
.mini-form-head p {
  margin: 0;
}
.inline-fields {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr 0.75fr;
  gap: 0.6rem;
}
.document-result {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.document-result:empty {
  display: none;
}
.preflight-card {
  border: 1px solid var(--line);
  border-left: 5px solid #94a3b8;
  border-radius: 14px;
  padding: 1rem;
  background: #fff;
}
.preflight-card.success { border-left-color: #16a34a; background: #f0fdf4; }
.preflight-card.warning { border-left-color: #f59e0b; background: #fffbeb; }
.preflight-card.danger { border-left-color: #dc2626; background: #fef2f2; }
.preflight-card h3,
.preflight-card h4 {
  margin: 0.45rem 0;
}
.preflight-card ul {
  margin-top: 0.25rem;
}
.preflight-card pre {
  overflow: auto;
  max-height: 420px;
  padding: 0.75rem;
  border-radius: 10px;
  background: #111827;
  color: #f9fafb;
}
.compact-kpis {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin: 0.75rem 0;
}
.compact-kpis .kpi {
  padding: 0.65rem;
}
.compact-kpis .kpi .value {
  font-size: 1.1rem;
}

@media (max-width: 640px) {
  .inline-fields {
    grid-template-columns: 1fr;
  }
}

/* v1.1 multi-line document editor */
.document-lines {
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 0.75rem;
  background: #f8fafc;
  display: grid;
  gap: 0.65rem;
}
.document-line-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.45fr) minmax(76px, 0.48fr) minmax(70px, 0.44fr) minmax(116px, 0.72fr) minmax(86px, 0.52fr) minmax(112px, 0.58fr) 42px;
  gap: 0.55rem;
  align-items: end;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.document-line-row label {
  display: grid;
  gap: 0.25rem;
  margin: 0;
}
.document-line-row .line-description {
  min-width: 0;
}
.line-calculated {
  display: grid;
  gap: 0.15rem;
  min-width: 80px;
  font-weight: 700;
  color: var(--text);
}
.line-calculated .subtext {
  font-weight: 500;
}
.document-line-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.document-line-totals {
  color: var(--muted);
  font-weight: 700;
}
.icon-button {
  width: auto;
  min-width: 2.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  font-size: 1.1rem;
  line-height: 1;
}

@media (max-width: 980px) {
  .document-line-row {
    grid-template-columns: 1fr 0.7fr 0.6fr;
  }
  .line-calculated,
  .document-line-row .icon-button {
    align-self: end;
  }
}
@media (max-width: 640px) {
  .document-line-row {
    grid-template-columns: 1fr;
  }
  .icon-button {
    width: 100%;
  }
}

/* v1.2 document preview / approval workflow */
.document-preview-paper {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  background: #fff;
}
.document-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  border-bottom: 2px solid var(--line);
  padding-bottom: 1rem;
}
.document-label {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 800;
}
.document-stamp {
  border: 2px solid #94a3b8;
  color: #475569;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}
.document-stamp.approved,
.document-stamp.issued,
.document-stamp.synced { border-color: #16a34a; color: #15803d; }
.document-stamp.pending_approval { border-color: #f59e0b; color: #b45309; }
.document-stamp.rejected,
.document-stamp.voided { border-color: #dc2626; color: #b91c1c; }
.document-preview-meta {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 0.7fr);
  gap: 1.5rem;
  margin: 1.25rem 0;
}
.document-preview-meta dl,
.document-preview-totals dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.45rem 0.75rem;
  margin: 0;
}
.document-preview-meta dt,
.document-preview-totals dt {
  color: var(--muted);
}
.document-preview-meta dd,
.document-preview-totals dd {
  margin: 0;
  font-weight: 700;
}
.client-name {
  font-size: 1.25rem;
  font-weight: 800;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
  display: inline-block;
}
.document-total-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}
.document-total-hero span {
  color: var(--muted);
  font-weight: 700;
}
.document-total-hero strong {
  font-size: 2rem;
}
.document-preview-lines {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.document-preview-lines th,
.document-preview-lines td {
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0.45rem;
  text-align: left;
}
.document-preview-lines th {
  background: #f8fafc;
  color: var(--muted);
}
.document-preview-lines .number {
  text-align: right;
  white-space: nowrap;
}
.document-preview-totals {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}
.document-preview-totals dl {
  min-width: 280px;
}
.document-preview-totals dd:last-child {
  font-size: 1.25rem;
}
.document-note {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.approval-timeline {
  display: grid;
  gap: 0.75rem;
  padding-left: 1.25rem;
}
.approval-timeline li {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.document-print-only { display: none; }

@media print {
  .topbar,
  .document-screen-only,
  .heading-actions,
  .document-result,
  .approval-timeline,
  nav {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .container {
    max-width: none;
    padding: 0;
  }
  .panel,
  .document-preview-paper {
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0;
  }
  .document-print-only { display: inline; }
  .document-preview-lines th,
  .document-preview-lines td {
    font-size: 10.5pt;
  }
}

@media (max-width: 760px) {
  .document-preview-head,
  .document-preview-meta,
  .document-total-hero {
    display: grid;
    grid-template-columns: 1fr;
  }
  .document-total-hero strong {
    font-size: 1.45rem;
  }
}

.auth-status { margin-left: 12px; font-size: 0.85rem; color: #6b7280; }
.link-button { background: none; border: none; color: #2563eb; cursor: pointer; padding: 0; font: inherit; }
.login-card { max-width: 520px; margin: 48px auto; }


.toast-root { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 10px; z-index: var(--z-toast); max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; border-radius: 12px; box-shadow: 0 10px 24px rgba(15, 23, 42, .16); border: 1px solid var(--line); background: #fff; color: #111827; }
.toast.success { border-color: #10b981; }
.toast.error { border-color: #ef4444; }
.toast.warning { border-color: #f59e0b; }
.toast.info { border-color: #0ea5e9; }
@page { size: A4; margin: 15mm 12mm; }
@media print { .document-preview { page-break-inside: avoid; } }
.tax-breakdown { margin-top: 1rem; }
.tax-breakdown table { width: 100%; border-collapse: collapse; }
.tax-breakdown th, .tax-breakdown td { border-bottom: 1px solid var(--line); padding: .45rem; }

.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .38); z-index: var(--z-modal); display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(520px, calc(100% - 32px)); box-sizing: border-box; background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 18px 50px rgba(15, 23, 42, .24); border: 1px solid var(--line); }
.modal-card h2 { margin-top: 0; }
.modal-input { width: 100%; margin: 12px 0; }
.global-nav { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.global-nav details { position: relative; }
.global-nav summary { cursor: pointer; list-style: none; padding: .35rem .55rem; border-radius: 10px; }
.global-nav details[open] summary, .global-nav summary:hover { background: rgba(255,255,255,.12); }
.global-nav details a { display: block; white-space: nowrap; padding: .45rem .7rem; color: inherit; }
.global-nav details[open] { background: rgba(255,255,255,.08); border-radius: 10px; }

/* v1.5 frontend foundation polish */
.field-error {
  color: #b91c1c;
  font-size: .82rem;
  margin-top: .25rem;
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}
button.is-loading::after {
  content: "";
  display: inline-block;
  width: .8em;
  height: .8em;
  margin-left: .45em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin .8s linear infinite;
  vertical-align: -0.12em;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state {
  display: grid;
  place-items: center;
  gap: .4rem;
  padding: 2rem;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #fafafa;
  text-align: center;
}
.empty-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
}
button.danger, .button-link.danger {
  background: #b91c1c;
  color: #fff;
  border-color: #991b1b;
}
.toast { cursor: pointer; }
.toast.success { background: #ecfdf5; }
.toast.error { background: #fef2f2; }
.toast.warning { background: #fffbeb; }
.toast.info { background: #eff6ff; }
[hidden] { display: none !important; }

/* v1.6 pagination */
.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .6rem;
  margin-top: .75rem;
  color: var(--muted);
  font-size: .92rem;
  flex-wrap: wrap;
}
.pagination button[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

/* v1.7 sortable tables and document editor */
.sort-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  cursor: pointer;
}
.sort-button:hover { color: var(--accent); background: transparent; }
.sort-button.active { color: var(--accent); }
.sort-button[disabled] { opacity: .55; cursor: progress; }
.notice {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 14px;
  padding: .85rem 1rem;
  background: #fff;
  margin-bottom: 1rem;
}
.notice.warning { border-left-color: #f59e0b; background: #fffbeb; }
#document-edit-form .document-lines[aria-disabled="true"] { opacity: .72; }

/* v1.9 dashboard KPI enhancements */
.small-note {
  font-size: 0.9rem;
  margin-top: -0.25rem;
}
.enhanced-kpis .kpi {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 205px;
}
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 0.2rem;
}
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
.kpi-delta.flat { color: var(--muted); }
.delta-icon {
  font-size: 0.72rem;
}
.sparkline {
  color: var(--primary);
  margin-top: 0.2rem;
}
.sparkline svg {
  width: 100%;
  height: 38px;
  display: block;
  overflow: visible;
}
.sparkline-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1;
}
.goal-progress {
  margin-top: auto;
  padding-top: 0.2rem;
}
.goal-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 0.2rem;
}
.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}
.goal-progress.ok .progress-fill { background: var(--success); }
.goal-progress.under .progress-fill { background: var(--warning); }
.goal-progress.over .progress-fill { background: var(--danger); }

/* v1.10: prevent role-gated actions from flashing before /api/auth/me resolves. */
body:not([data-role-ready]) [data-require-role] {
  visibility: hidden;
}

.goal-settings-table input[type="number"] {
  width: 160px;
}
.goal-settings-actions {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
}

/* v1.20 freee readiness checklist */
.readiness-hero {
  background: linear-gradient(135deg, #ffffff, #eefdf8);
}
.readiness-overview {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
  gap: 1rem;
  align-items: center;
}
.readiness-big-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-size: 1.2rem;
  font-weight: 900;
  background: #dcfce7;
  color: #166534;
}
.readiness-big-status.warning { background: #fef3c7; color: #92400e; }
.readiness-big-status.blocker { background: #fee2e2; color: #991b1b; }
.readiness-kpis .kpi { background: #fff; }
.readiness-actions,
.readiness-list {
  display: grid;
  gap: 0.65rem;
  padding-left: 0;
  list-style: none;
}
.readiness-actions { counter-reset: readiness-action; }
.readiness-actions > .readiness-item::before {
  counter-increment: readiness-action;
  content: counter(readiness-action);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 900;
  flex: 0 0 auto;
}
.readiness-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.readiness-item.blocker { border-color: #fecaca; background: #fff7f7; }
.readiness-item.warning { border-color: #fde68a; background: #fffdf3; }
.readiness-item-main {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
}
.readiness-item-label { font-weight: 800; }
.readiness-item-detail { color: var(--muted); font-size: 0.9rem; margin-top: 0.15rem; }
.readiness-section {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.8rem;
  background: #fff;
}
.readiness-section.blocker { border-color: #fecaca; }
.readiness-section.warning { border-color: #fde68a; }
.readiness-section summary {
  cursor: pointer;
  font-weight: 900;
  display: flex;
  gap: 0.55rem;
  align-items: center;
}
.small-link { padding: 0.45rem 0.6rem; font-size: 0.86rem; white-space: nowrap; }
.raw-details { margin-top: 1rem; }
@media (max-width: 720px) {
  .readiness-overview { grid-template-columns: 1fr; }
  .readiness-item { align-items: flex-start; flex-direction: column; }
}

/* v1.39 assignment workbench */
.grid.two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.section-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.inline-form {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.inline-form label {
  min-width: 12rem;
}
@media (max-width: 900px) {
  .grid.two-columns { grid-template-columns: 1fr; }
  .inline-form { align-items: stretch; }
}

/* v1.40 assignment workbench refinements */
.grid.three-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.compact-actions .danger { margin-left: .25rem; }
@media (max-width: 980px) {
  .grid.three-columns { grid-template-columns: 1fr; }
}

/* v1.42 notifications */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 .35rem;
  margin-left: .25rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .74rem;
  font-weight: 900;
}
.highlight-row td {
  background: #fff7ed;
}

.focus-highlight {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 4px;
  transition: outline-color 0.6s ease;
}

/* v1.54 estimate assist */
.assist-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem 1rem;
  background: #f8fafc;
}
.assist-panel summary {
  cursor: pointer;
  font-weight: 800;
}
.assist-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
  margin: .75rem 0;
}
.assist-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .75rem;
  background: #fff;
}
.assist-results h4 { margin: .5rem 0 .25rem; }

/* v1.56 work log quick input */
.quick-next-action {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: .75rem;
  background: #fbfdff;
}
.mobile-work-log-form textarea {
  min-height: 8rem;
}

/* v1.60: My Work card layout/preferences */
.my-work-card-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1rem;
  align-items: start;
}
.my-work-card-wide {
  grid-column: 1 / -1;
}
.my-work-card[hidden] {
  display: none !important;
}
.my-work-card-preferences-table input[type="number"] {
  max-width: 6rem;
}
.my-work-card-preferences-table .card-hidden-label {
  opacity: 0.7;
}
.my-work-card.is-hidden-by-preference {
  display: none !important;
}


/* v2.75.14: My Work today focus hero */
.my-work-focus-panel {
  border: 1px solid rgba(37, 99, 235, .18);
  background: linear-gradient(135deg, rgba(239, 246, 255, .95), rgba(255, 255, 255, .92));
}
.my-work-focus-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 180px);
  gap: 1rem;
  align-items: stretch;
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: 22px;
  padding: 1.1rem;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
}
.my-work-focus-hero.danger { border-color: rgba(220, 38, 38, .28); background: linear-gradient(135deg, rgba(254, 242, 242, .96), rgba(255,255,255,.9)); }
.my-work-focus-hero.warning { border-color: rgba(245, 158, 11, .30); background: linear-gradient(135deg, rgba(255, 251, 235, .96), rgba(255,255,255,.9)); }
.my-work-focus-hero.success { border-color: rgba(22, 163, 74, .24); background: linear-gradient(135deg, rgba(240, 253, 244, .96), rgba(255,255,255,.9)); }
.my-work-focus-main h3 {
  margin: .15rem 0 .35rem;
  font-size: clamp(1.25rem, 2vw, 1.85rem);
  letter-spacing: -.02em;
}
.my-work-focus-metric {
  display: grid;
  place-items: center;
  gap: .35rem;
  border-radius: 18px;
  padding: .9rem;
  background: rgba(15, 23, 42, .04);
  text-align: center;
}
.my-work-focus-metric span { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.my-work-focus-metric strong { font-size: clamp(1.4rem, 3vw, 2.2rem); line-height: 1.05; }
@media (max-width: 760px) {
  .my-work-focus-hero { grid-template-columns: 1fr; }
  .my-work-focus-metric { place-items: start; text-align: left; }
}

/* v1.61: mobile sales workflow and responsive My Work home */
.mobile-priority-panel {
  display: none;
}
.mobile-focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
}
.mobile-focus-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .85rem;
  background: #fff;
}
.mobile-focus-card strong {
  display: block;
  font-size: 1.4rem;
  margin: .15rem 0;
}
.mobile-work-log-steps {
  display: grid;
  gap: 1rem;
}
.mobile-stepper {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.mobile-step-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .35rem .75rem;
  background: #f8fafc;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}
.mobile-step-pill.is-active {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #075985;
}
.mobile-step {
  display: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  background: #fff;
}
.mobile-step.is-active {
  display: block;
}
.mobile-step h3 {
  margin-top: 0;
}
.mobile-step-actions,
.mobile-quick-date-row,
.mobile-sticky-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}
.mobile-quick-date-row {
  margin: .35rem 0 .75rem;
}
.mobile-sticky-actions {
  position: sticky;
  bottom: .75rem;
  z-index: 20;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 30px rgba(15, 23, 42, .12);
  justify-content: flex-end;
}
.mobile-work-log-panel textarea {
  min-height: 10rem;
}
.mobile-work-log-panel select,
.mobile-work-log-panel input,
.mobile-work-log-panel textarea {
  font-size: 16px;
}
.mobile-card-list {
  display: grid;
  gap: .55rem;
}
.mobile-card-link {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem;
  background: #fff;
  text-decoration: none;
  color: inherit;
  display: block;
}
.mobile-card-link .mobile-card-meta {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: .25rem;
}
@media (max-width: 760px) {
  .mobile-priority-panel {
    display: block;
  }
  .my-work-card-layout {
    grid-template-columns: 1fr;
  }
  .my-work-card-wide {
    grid-column: auto;
  }
  .my-work-card .table-wrap {
    overflow-x: auto;
  }
  .page-header,
  .compact-hero,
  .section-heading-row {
    align-items: stretch;
  }
  .page-actions,
  .compact-actions,
  .form-actions {
    width: 100%;
  }
  .page-actions .button-link,
  .form-actions button,
  .form-actions .button-link,
  .mobile-sticky-actions button,
  .mobile-sticky-actions .button-link {
    flex: 1 1 auto;
    text-align: center;
  }
  .form-grid,
  .detail-grid,
  .compact-form {
    grid-template-columns: 1fr !important;
  }
  .panel {
    padding: 1rem;
  }
  .my-work-card[data-my-work-card="assignment_summary"],
  .my-work-card[data-my-work-card="unassigned_deals"] {
    display: none;
  }
}

/* v1.63 structured sales memo helpers */
.structured-memo-fields {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.structured-memo-fields.compact {
  gap: 0.6rem;
}
.structured-memo-line {
  margin-top: 0.25rem;
  line-height: 1.45;
}
.section-subhead {
  margin-top: 0.5rem;
}

/* v1.64 cross-screen UI polish */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1000;
  background: #fff;
  color: #111827;
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  font-weight: 800;
}
.skip-link:focus { top: 0.8rem; }
.brand { color: #fff; text-decoration: none; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.global-nav { align-items: center; }
.global-nav details {
  position: relative;
  border-radius: 10px;
}
.global-nav summary {
  list-style: none;
  cursor: pointer;
  color: #fff;
  opacity: 0.94;
  padding: 0.35rem 0.45rem;
  border-radius: 9px;
}
.global-nav summary::-webkit-details-marker { display: none; }
.global-nav details[open] summary,
.global-nav a.is-active,
.global-nav summary.is-active {
  background: rgba(255,255,255,0.14);
  text-decoration: none;
}
.global-nav details[open] {
  background: rgba(17,24,39,0.98);
}
.global-nav details[open] > a {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  min-width: 190px;
}
.nav-separator {
  display: inline-block;
  width: 1px;
  height: 1.6rem;
  background: rgba(255,255,255,0.25);
}
.nav-quick-link,
.topbar-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 800;
}
.topbar-button {
  cursor: pointer;
  box-shadow: none;
}
.topbar-button:hover,
.nav-quick-link:hover {
  background: rgba(255,255,255,0.2);
  text-decoration: none;
}
.shortcut-key {
  font-size: 0.72rem;
  color: #dbeafe;
  border: 1px solid rgba(219,234,254,0.35);
  border-radius: 5px;
  padding: 0 0.22rem;
}
.page-context-bar {
  width: min(1180px, calc(100% - 2rem));
  margin: 1rem auto 0;
}
.page-context-shell {
  display: grid;
  gap: 0.75rem;
  background: rgba(255,255,255,0.86);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(10px);
}
.page-context-main {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-context-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
}
.page-context-description {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.page-context-actions,
.page-context-chips {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}
.context-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f9fafb;
  color: #374151;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 800;
}
.context-chip:hover { text-decoration: none; background: #eef2ff; }
.context-chip.primary { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.ui-popover {
  position: fixed;
  right: 1rem;
  top: 4.3rem;
  z-index: 60;
  width: min(360px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.18);
  padding: 1rem;
}
.ui-popover h2 { margin: 0 0 0.7rem; font-size: 1rem; }
.ui-popover .setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.55rem 0;
  border-top: 1px solid #f3f4f6;
}
.ui-popover .setting-row:first-of-type { border-top: 0; }
[data-theme="dark"] .ui-popover {
  background: rgba(15, 23, 42, 0.96);
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.42);
}
[data-theme="dark"] .ui-popover .setting-row { border-top-color: rgba(148, 163, 184, 0.22); }
[data-theme="dark"] .ui-popover .subtext { color: #cbd5e1; }
.segmented {
  display: inline-flex;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 0.2rem;
  gap: 0.15rem;
}
.segmented button {
  border: 0;
  background: transparent;
  color: #4b5563;
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
}
.segmented button.active {
  background: #fff;
  color: var(--accent-dark);
  box-shadow: 0 1px 6px rgba(15,23,42,0.12);
}
[data-theme="dark"] .segmented {
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.22);
}
[data-theme="dark"] .segmented button { color: #cbd5e1; }
[data-theme="dark"] .segmented button.active {
  background: rgba(37, 99, 235, 0.28);
  color: #dbeafe;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.32);
}
body.ui-wide .container,
body.ui-wide .page-context-bar { width: min(1480px, calc(100% - 2rem)); }
body.ui-dense .container { margin-top: 1rem; }
body.ui-dense .card,
body.ui-dense .panel { padding: 0.8rem; border-radius: 12px; }
body.ui-dense th,
body.ui-dense td { padding: 0.45rem 0.55rem; }
body.ui-dense input,
body.ui-dense select,
body.ui-dense textarea,
body.ui-dense button { padding: 0.48rem 0.58rem; }
.table-wrap table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody tr:hover { background: #f8fafc; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(37,99,235,0.35);
  outline-offset: 2px;
}
.command-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(15,23,42,0.54);
  display: grid;
  place-items: start center;
  padding: 9vh 1rem 1rem;
}
.command-palette {
  position: relative;
  z-index: var(--z-modal-content);
  box-sizing: border-box;
  width: min(760px, 100%);
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 26px 70px rgba(0,0,0,0.22);
  overflow: hidden;
}
.command-palette header {
  min-width: 0;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.5rem;
}
.command-input {
  width: 100%;
  min-width: 0;
  border-radius: 14px;
  font-size: 1.05rem;
  padding: 0.85rem 1rem;
}
.command-results {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.45rem;
}
.command-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  background: #fff;
  color: var(--text);
  border: 0;
  text-align: left;
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
}
.command-item:hover,
.command-item.active {
  background: #eff6ff;
}

.command-search-state {
  margin: 0.35rem 0.45rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}
.command-search-state.warning {
  background: #fff7ed;
  color: #9a3412;
}
.command-item-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.command-item-title .badge {
  flex: 0 0 auto;
  font-size: 0.68rem;
  padding: 0.12rem 0.4rem;
}
.command-item > span:first-child { min-width: 0; }
.command-item-title { min-width: 0; overflow-wrap: anywhere; word-break: normal; white-space: normal; font-weight: 900; }
.command-item-meta { min-width: 0; overflow-wrap: anywhere; word-break: normal; white-space: normal; color: var(--muted); font-size: 0.82rem; margin-top: 0.16rem; }
.command-item-group { max-width: 7.5rem; overflow-wrap: anywhere; text-align: right; color: #1d4ed8; font-size: 0.78rem; font-weight: 900; }
body.command-palette-open .mobile-topbar-reveal,
body.command-palette-open .mobile-bottom-nav {
  display: none !important;
}
body.command-palette-open {
  overflow: hidden;
}
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 999px;
  box-shadow: 0 15px 35px rgba(15,23,42,0.22);
}
@media (max-width: 860px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar nav { width: 100%; gap: 0.45rem; }
  .global-nav details[open] > a { min-width: 0; }
  .nav-separator { display: none; }
  .page-context-main { display: grid; }
  .page-context-actions { width: 100%; }
  .context-chip { font-size: 0.78rem; }
  .command-palette-overlay { padding-top: 6vh; }
}

@media (max-width: 480px) {
  .command-palette-overlay {
    padding:
      max(.65rem, env(safe-area-inset-top))
      max(.5rem, env(safe-area-inset-right))
      calc(1rem + env(safe-area-inset-bottom))
      max(.5rem, env(safe-area-inset-left));
    place-items: start center;
  }
  .command-palette {
    width: 100%;
    max-width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1.25rem);
    border-radius: 18px;
  }
  .command-palette header {
    padding: .85rem;
  }
  .command-input {
    font-size: 1rem;
    padding: .75rem .85rem;
  }
  .command-results {
    padding: .35rem;
  }
  .command-item {
    grid-template-columns: 1fr;
    gap: .35rem;
    padding: .72rem .78rem;
  }
  .command-item-group {
    justify-self: start;
    max-width: 100%;
    text-align: left;
    font-size: .74rem;
  }
}

@media print {
  .skip-link,
  .topbar,
  .page-context-bar,
  .back-to-top,
  .toast-root { display: none !important; }
}

/* v1.65 onboarding / input guide */
.guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.56);
  display: grid;
  place-items: center;
  padding: 1.25rem;
}
.guide-panel {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 2rem));
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  padding: 1.4rem;
}
.guide-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}
.guide-header h2 { margin: 0.15rem 0 0.3rem; }
.guide-section { margin: 1rem 0; }
.guide-section h3 { margin: 0 0 0.4rem; }
.guide-list { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.35rem; }
.guide-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1rem; }
.guide-directory {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.guide-directory-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 1rem;
  display: grid;
  gap: 0.55rem;
}
.guide-directory-card h3 { margin: 0; }
.guide-mini-steps { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.input-guide-callout {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.8rem;
}
.input-guide-callout ul { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.input-guide-callout li { margin: 0.2rem 0; }
.context-chip.guide-chip {
  border: 1px solid var(--line);
  color: var(--text);
  background: #fff;
}
.guide-directory #guide-search, #guide-search { min-width: min(320px, 100%); }
@media (max-width: 760px) {
  .guide-header { display: grid; }
  .guide-panel { padding: 1rem; }
  .guide-directory { grid-template-columns: 1fr; }
}

/* v1.66 onboarding checklist */
.onboarding-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.onboarding-summary .kpi { min-height: 88px; }
.onboarding-checklist {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 14px;
  background: var(--card-bg, #fff);
  margin-bottom: 1rem;
  overflow: hidden;
}
.onboarding-checklist > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 1rem;
  padding: 1rem;
  cursor: pointer;
  list-style: none;
}
.onboarding-checklist > summary::-webkit-details-marker { display: none; }
.onboarding-checklist-progress {
  display: grid;
  align-content: center;
  gap: .5rem;
  color: var(--muted-color, #6b7280);
  font-size: .9rem;
}
.onboarding-progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef2f7;
}
.onboarding-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #14b8a6);
  border-radius: inherit;
}
.onboarding-item-list {
  display: grid;
  gap: .75rem;
  margin: 0;
  padding: 0 1rem 1rem 1rem;
  list-style: none;
}
.onboarding-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: .85rem;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  background: #fbfdff;
}
.onboarding-item.status-done { background: #f0fdf4; border-color: #bbf7d0; }
.onboarding-item.status-skipped { background: #fffbeb; border-color: #fde68a; }
.onboarding-item-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.onboarding-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .4rem;
}
.guide-progress-list {
  display: grid;
  gap: .65rem;
}
.guide-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: .75rem;
  border: 1px solid #eef2f7;
  border-radius: 12px;
}
.guide-header-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}
@media (max-width: 760px) {
  .onboarding-hero,
  .onboarding-checklist > summary,
  .onboarding-item,
  .guide-progress-row {
    grid-template-columns: 1fr;
    display: grid;
  }
  .onboarding-item-actions { justify-content: flex-start; }
}

/* v1.67: sales pipeline board */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  align-items: start;
}
.pipeline-column {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: .85rem;
  min-height: 240px;
}
.pipeline-column-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
  padding-bottom: .65rem;
  margin-bottom: .75rem;
}
.pipeline-column-header h2 {
  margin: 0;
  font-size: 1rem;
}
.pipeline-card {
  display: grid;
  gap: .55rem;
  border: 1px solid var(--border, #e5e7eb);
  border-left: 4px solid #9ca3af;
  border-radius: 12px;
  padding: .75rem;
  margin-bottom: .75rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.pipeline-card.health-healthy { border-left-color: #16a34a; }
.pipeline-card.health-caution { border-left-color: #f59e0b; }
.pipeline-card.health-risk,
.pipeline-card.health-stalled { border-left-color: #dc2626; }
.pipeline-card.health-closed { border-left-color: #64748b; }
.pipeline-card-head,
.pipeline-card-meta,
.pipeline-card-kpis {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.pipeline-card-title {
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}
.pipeline-card-meta,
.pipeline-card-kpis,
.pipeline-risk-list {
  font-size: .85rem;
  color: var(--muted, #64748b);
}
.pipeline-risk-list {
  margin: 0;
  padding-left: 1.1rem;
}
.button-row.compact { gap: .35rem; }
.button-row.compact .ghost { padding: .25rem .45rem; font-size: .78rem; }

/* v1.68 estimate wizard */
.estimate-wizard-panel { overflow: visible; isolation: isolate; }
.estimate-wizard-form { display: grid; gap: 1.25rem; }
.wizard-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: 0; padding: 0; list-style: none; }
.wizard-progress li { border: 1px solid var(--border-color, #d6dde6); border-radius: 999px; padding: .55rem .75rem; text-align: center; color: var(--muted-color, #637083); background: var(--surface-muted, #f7f9fb); font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wizard-progress li.active { background: #e6f0ff; border-color: #8bb7ff; color: #1658b8; font-weight: 700; }
.wizard-progress li.complete { background: #e9f8ef; border-color: #8bd2a5; color: #187144; }
.wizard-step { border: 1px solid var(--border-color, #d6dde6); border-radius: 16px; padding: 1rem; background: var(--surface, #fff); }
.wizard-method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: .75rem; margin: 1rem 0; min-width: 0; }
.wizard-method-card { display: grid; gap: .35rem; text-align: left; border: 1px solid var(--border-color, #d6dde6); border-radius: 14px; padding: 1rem; background: #fff; cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.wizard-method-card:hover, .wizard-method-card.active { border-color: #4b8fe8; box-shadow: 0 0 0 3px rgba(75, 143, 232, .12); clip-path: inset(-8px round 14px); }
.wizard-method-card span { color: var(--muted-color, #637083); font-size: .9rem; overflow-wrap: anywhere; word-break: keep-all; }
.wizard-assist-zone { margin-top: 1rem; display: grid; gap: .75rem; }
.assist-search-row { display: flex; gap: .5rem; align-items: center; }
.assist-search-row input { flex: 1; min-width: 0; }
.wizard-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: flex-end; padding-top: .5rem; border-top: 1px solid var(--border-color, #d6dde6); }
.wizard-review-card { display: grid; gap: 1rem; }
.success-box { border: 1px solid #8bd2a5; background: #f0fbf4; border-radius: 14px; padding: 1rem; }
@media (max-width: 760px) {
  .wizard-progress { grid-template-columns: 1fr 1fr; }
  .assist-search-row { flex-direction: column; align-items: stretch; }
  .wizard-actions { justify-content: stretch; }
  .wizard-actions button { flex: 1 1 auto; }
}

/* v1.70 estimate profitability/risk check */
.estimate-profitability-panel .risk-check-list {
  display: grid;
  gap: 0.6rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}
.risk-check-item {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: start;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 0.75rem;
  background: var(--surface-muted, #f9fafb);
}
.risk-check-item.danger,
.risk-check-item.blocker {
  border-color: #fecaca;
  background: #fff1f2;
}
.risk-check-item.warning {
  border-color: #fde68a;
  background: #fffbeb;
}
.risk-check-item.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

/* v1.71 approval comments */
.approval-checklist {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
  color: #475569;
  font-size: 0.9rem;
}

/* v1.72 estimate approval queue */
.approval-queue-root .strong-link { display: inline-block; font-weight: 700; }
.approval-risk-list { margin: 0.25rem 0 0; padding-left: 1.1rem; font-size: 0.86rem; }
.approval-risk-list li { margin: 0.1rem 0; }
#estimate-approval-filters-card .inline-form { align-items: end; }

/* v1.76 function-level UX enhancements */
.compact-hero {
  padding: 1.4rem;
}
.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.screen-ux-panel {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.9rem;
  padding: 0.9rem;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}
.persona-chips {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.screen-ux-main {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 0.9rem;
}
.screen-ux-main strong { display: block; margin-bottom: 0.25rem; }
.screen-ux-main p { margin: 0; color: var(--muted); }
.signal-list {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0;
  margin: 0.25rem 0 0;
  list-style: none;
}
.signal-list span,
.signal-list li {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  background: #fff;
  color: #374151;
  font-size: 0.82rem;
  font-weight: 700;
}
.signal-list.vertical {
  display: grid;
  gap: 0.35rem;
}
.signal-list.vertical li {
  width: fit-content;
}
.screen-workflow,
.workspace-flow {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0;
  margin: 0.25rem 0 0;
  list-style: none;
  counter-reset: step;
}
.screen-workflow li,
.workspace-flow li {
  counter-increment: step;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
}
.screen-workflow li::before,
.workspace-flow li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}
.workspace-quick-start {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
}
.workspace-quick-start h2 { margin: 0 0 0.25rem; }
.workspace-quick-grid {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}
.workspace-quick-link {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.8rem;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  font-weight: 800;
}
.workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
}
.workspace-card {
  display: grid;
  gap: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  padding: 1rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}
.workspace-card.success { border-color: #bbf7d0; }
.workspace-card.warning { border-color: #fde68a; }
.workspace-card.info { border-color: #bfdbfe; }
.workspace-card-header {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}
.workspace-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 14px;
  background: #f3f4f6;
  font-size: 1.25rem;
}
.workspace-card h2,
.workspace-card h3 { margin: 0; }
.workspace-card p { margin: 0.2rem 0 0; }
.workspace-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.workspace-section {
  display: grid;
  gap: 0.35rem;
}
@media (max-width: 860px) {
  .screen-ux-main {
    grid-template-columns: 1fr;
  }
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* v1.77 empty-state and first-action CTA enhancements */
.empty-state {
  min-height: 11rem;
  padding: 2.4rem 1.4rem;
}
.empty-state .empty-title {
  color: var(--text);
  font-size: 1.05rem;
}
.empty-hint {
  max-width: 48rem;
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
}
.empty-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.35rem;
}
.empty-actions button,
.empty-actions .button-link {
  min-height: 2.25rem;
}
.first-action-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 1rem;
  align-items: center;
  border: 1px solid #dbeafe;
  background: linear-gradient(135deg, #f8fbff, #ffffff);
}
.first-action-panel h2,
.first-action-panel p {
  margin-top: 0;
}
.first-action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.65rem 0 0;
  padding: 0;
  list-style: none;
}
.first-action-list li {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0.25rem 0.6rem;
  font-size: 0.86rem;
  color: #374151;
}
@media (max-width: 760px) {
  .first-action-panel {
    grid-template-columns: 1fr;
  }
  .empty-actions {
    display: grid;
    width: 100%;
  }
  .empty-actions button,
  .empty-actions .button-link {
    width: 100%;
    justify-content: center;
  }
}

/* v1.79 setup wizard */
.setup-wizard-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.setup-wizard-lead .screen-workflow {
  margin-bottom: 0;
}
.setup-wizard-group {
  border: 1px solid var(--border-color, #d9e2ec);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}
.setup-wizard-group > summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-weight: 700;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.setup-wizard-group > summary::-webkit-details-marker { display: none; }
.setup-step-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border-color, #d9e2ec);
}
.setup-step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid #edf2f7;
}
.setup-step:last-child { border-bottom: 0; }
.setup-step.done { background: #f8fff9; }
.setup-step.pending.required { background: #fffdf5; }
.setup-step-index {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: #edf2f7;
  color: #334155;
}
.setup-step.done .setup-step-index { background: #dcfce7; color: #166534; }
.setup-step-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.setup-step-main p { margin: 0.25rem 0 0; }
.setup-step-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.setup-count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}
@media (max-width: 760px) {
  .setup-wizard-hero { flex-direction: column; }
  .setup-step {
    grid-template-columns: 36px minmax(0, 1fr);
  }
  .setup-step-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* v1.80 freee rehearsal */
.freee-rehearsal-hero .readiness-overview {
  align-items: stretch;
}
.rehearsal-group summary {
  gap: .75rem;
}
.rehearsal-step .actions {
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .rehearsal-step {
    align-items: stretch;
  }
  .rehearsal-step .actions,
  .freee-rehearsal-hero .readiness-kpis {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* v1.81 client registration brush-up */
.client-registration-panel .form-section {
  border: 1px solid var(--border-color, #d9e2ec);
  border-radius: 14px;
  padding: 1rem;
  margin: 0 0 1rem 0;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
}
.client-registration-panel legend {
  font-weight: 700;
  padding: 0 .4rem;
}
.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .5rem .8rem;
}
.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .65rem;
  border: 1px solid var(--border-color, #d9e2ec);
  border-radius: 10px;
  background: #fff;
}
.client-assist-panel {
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
  padding: 1rem;
}
.assist-success {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.tag-stack {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}
@media (max-width: 760px) {
  .client-registration-panel .form-section { padding: .75rem; }
  .checkbox-grid { grid-template-columns: 1fr; }
}

/* v1.82 client detail */
.client-detail-hero .section-heading-row { align-items: flex-start; }
.client-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.client-profile-grid > div {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-muted, #f8fafc);
}
.client-profile-grid strong { display: block; margin-bottom: 0.25rem; }
.client-detail-tabs-panel .tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.client-detail-tabs-panel .tab-nav button.active {
  background: var(--primary, #2563eb);
  color: #fff;
  border-color: var(--primary, #2563eb);
}
.client-detail-tabs-panel .tab-content { min-height: 8rem; }
@media (max-width: 760px) {
  .client-profile-grid { grid-template-columns: 1fr; }
  .client-detail-tabs-panel .tab-nav button { flex: 1 1 45%; }
}

/* v1.83: client sales knowledge */
.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 1rem;
  align-items: start;
}
.panel-like {
  border: 1px solid var(--border-color, #d7dde8);
  border-radius: 14px;
  background: var(--panel-bg, #fff);
  padding: 1rem;
}
.compact-form label {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
}
.knowledge-note-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}
.knowledge-note-card {
  border: 1px solid var(--border-color, #d7dde8);
  border-radius: 12px;
  padding: 0.8rem;
  background: #fff;
}
.knowledge-note-card.pinned {
  border-color: #f0b429;
  background: #fffaf0;
}
.knowledge-recommendations {
  margin-top: 1rem;
}
.knowledge-recommendation {
  display: grid;
  gap: 0.2rem;
  border-left: 4px solid #4f7cff;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background: #f7f9ff;
}
.knowledge-recommendation.warning { border-left-color: #d97706; background: #fff7ed; }
.knowledge-recommendation.danger { border-left-color: #dc2626; background: #fef2f2; }
@media (max-width: 900px) {
  .knowledge-layout { grid-template-columns: 1fr; }
}

/* v1.84: client-detail direct action polish */
.client-actions-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.2fr);
  align-items: start;
}
.client-actions-quick-create,
.client-action-card,
.client-followup-panel {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 14px;
  background: var(--surface-muted, #f8fafc);
  padding: 1rem;
}
.client-action-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.client-action-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 150px;
}
.client-action-card .button-link { margin-top: auto; }
.client-action-card.success { border-left: 4px solid #16a34a; }
.client-action-card.warning { border-left: 4px solid #f59e0b; }
.client-action-card.info { border-left: 4px solid #0284c7; }
.client-action-card.muted { border-left: 4px solid #94a3b8; }
.client-quick-deal-form.compact-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.client-followup-panel { margin-top: 1rem; }
@media (max-width: 820px) {
  .client-actions-layout,
  .client-quick-deal-form.compact-form {
    grid-template-columns: 1fr;
  }
}

/* v1.94 production readiness */
.production-readiness-hero .readiness-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.readiness-group {
  border: 1px solid var(--border-color, #d9e1ec);
  border-radius: 14px;
  background: var(--surface-color, #fff);
  margin-bottom: .8rem;
  overflow: hidden;
}
.readiness-group > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  font-weight: 700;
}
.readiness-summary-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: flex-end;
}
.readiness-check-list {
  list-style: none;
  padding: .5rem 1rem 1rem;
  margin: 0;
  display: grid;
  gap: .65rem;
}
.readiness-check-list.priority {
  padding: 0;
}
.readiness-check {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem;
  align-items: center;
  border: 1px solid var(--border-color, #d9e1ec);
  border-left-width: 5px;
  border-radius: 12px;
  padding: .8rem;
  background: #fff;
}
.readiness-check.status-ok { border-left-color: #2f9e44; }
.readiness-check.status-warning { border-left-color: #f08c00; }
.readiness-check.status-blocker { border-left-color: #e03131; }
.readiness-check-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.readiness-check p { margin: .25rem 0 0; }
.readiness-check-actions {
  display: flex;
  justify-content: flex-end;
}
.readiness-support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.compact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .5rem;
}
.compact-list li {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .readiness-check {
    grid-template-columns: 1fr;
  }
  .readiness-check-actions {
    justify-content: flex-start;
  }
}

/* v1.95 freee rehearsal report */
.freee-rehearsal-report-hero .readiness-overview {
  align-items: stretch;
}
.danger-card {
  border-color: #f0b8b8;
  background: #fff7f7;
}
.warning-card {
  border-color: #f2d28c;
  background: #fffaf0;
}
.raw-details pre,
#freee-rehearsal-report-raw pre {
  max-height: 520px;
  overflow: auto;
}
@media (max-width: 760px) {
  .freee-rehearsal-report-hero .readiness-kpis {
    grid-template-columns: 1fr 1fr;
  }
}

/* v1.99.3: deal detail document form layout hardening */
.document-flow-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
  gap: 1.25rem;
  width: 100%;
}
.deal-document-form,
.document-flow-grid .mini-form {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}
.deal-document-form input,
.deal-document-form select,
.deal-document-form textarea,
.document-flow-grid .mini-form input,
.document-flow-grid .mini-form select,
.document-flow-grid .mini-form textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.document-lines {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.document-line-row {
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.45fr) minmax(80px, .55fr) minmax(72px, .45fr) minmax(120px, .75fr) minmax(90px, .55fr) minmax(96px, .55fr) auto;
  max-width: 100%;
}
.document-line-row > * {
  min-width: 0;
}
.document-line-row input,
.document-line-row select {
  min-width: 0;
}
.deal-document-form .document-lines {
  padding: .7rem;
}
.deal-document-form .document-line-row {
  grid-template-columns: minmax(0, 1fr) minmax(110px, .45fr);
  gap: .65rem;
  align-items: end;
}
.deal-document-form .document-line-row .line-service-item,
.deal-document-form .document-line-row .line-description,
.deal-document-form .document-line-row .line-calculated {
  grid-column: 1 / -1;
}
.deal-document-form .document-line-row .line-calculated {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .45rem .55rem;
  border-radius: 10px;
  background: #f8fafc;
}
.deal-document-form .document-line-row .icon-button {
  width: 100%;
  min-width: 0;
}
.deal-document-form .assist-panel {
  max-width: 100%;
  overflow-x: auto;
}
.deal-document-form .assist-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}
@media (max-width: 1180px) {
  .document-flow-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .document-flow-grid {
    gap: 1rem;
  }
  .deal-document-form {
    padding: .85rem;
  }
  .deal-document-form .document-line-row {
    grid-template-columns: 1fr;
  }
  .deal-document-form .document-line-toolbar {
    display: grid;
    justify-items: stretch;
  }
  .deal-document-form .document-line-toolbar button {
    width: 100%;
  }
}

/* v1.99.4 document polish: cleaner quotation/invoice paper, better responsive tables */
.document-preview-paper {
  position: relative;
  overflow: hidden;
  border: 1px solid #dbeafe;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.10);
  padding: clamp(1.25rem, 2.8vw, 2.25rem);
}
.document-preview-paper::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 8px;
  background: linear-gradient(90deg, #0f172a, #2563eb, #38bdf8);
}
.document-preview-head {
  border-bottom: 1px solid #cbd5e1;
  padding-top: .35rem;
  padding-bottom: 1.15rem;
}
.document-preview-head h2 {
  margin: .15rem 0 .25rem;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  letter-spacing: -0.035em;
}
.document-label {
  color: #2563eb;
  text-transform: uppercase;
}
.document-stamp {
  border-width: 1.5px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.75);
}
.document-preview-meta {
  align-items: start;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 1rem;
}
.client-name {
  border-bottom: 0;
  padding-bottom: .15rem;
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
}
.document-total-hero {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  box-shadow: 0 16px 35px rgba(37, 99, 235, .18);
}
.document-total-hero span { color: rgba(255,255,255,.78); }
.document-total-hero strong { color: #fff; letter-spacing: -0.035em; }
.document-preview-lines {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
.document-preview-lines th {
  background: #0f172a;
  color: #fff;
  border-bottom: 0;
  font-size: .78rem;
  letter-spacing: .04em;
}
.document-preview-lines td {
  background: #fff;
  vertical-align: top;
}
.document-preview-lines tbody tr:nth-child(even) td { background: #f8fafc; }
.document-preview-totals dl,
.tax-breakdown table {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.document-preview-totals dl {
  padding: .75rem .9rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}
.tax-breakdown h3,
.document-note h3 { color: #0f172a; }
.tax-breakdown th {
  background: #eff6ff;
  color: #1e3a8a;
}
.document-note {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
}
@media (max-width: 760px) {
  .document-preview-paper { padding: 1rem; }
  .document-preview-lines {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .document-preview-meta { padding: .85rem; }
}
@media print {
  .document-preview-paper::before { height: 4px; }
  .document-preview-paper { box-shadow: none; border: none; }
  .document-total-hero { box-shadow: none; }
}

/* v1.99.9 function-screen UX polish */
.screen-toolbelt {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, .7fr) minmax(260px, .9fr);
  gap: .85rem;
  margin-top: .95rem;
  align-items: stretch;
}
.function-sibling-rail,
.status-legend,
.screen-checklist-card {
  border: 1px solid rgba(148, 163, 184, .32);
  background: rgba(255, 255, 255, .82);
  border-radius: 16px;
  padding: .85rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .045);
}
.function-sibling-rail,
.status-legend {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  align-content: flex-start;
}
.context-chip.subtle {
  background: #fff;
  color: #334155;
  border-color: #dbe4f0;
}
.context-chip.subtle:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  text-decoration: none;
}
.screen-checklist-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
  margin-bottom: .55rem;
}
.screen-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .45rem;
}
.screen-checklist li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: .5rem;
  align-items: start;
  color: #334155;
  line-height: 1.45;
}
.screen-check-index {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  font-size: .8rem;
}
.panel,
.card,
.page-card,
.workspace-card,
.client-action-card,
.readiness-group,
.setup-wizard-group {
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.panel:focus-within,
.page-card:focus-within,
.workspace-card:focus-within,
.client-action-card:focus-within {
  border-color: rgba(37, 99, 235, .42);
  box-shadow: 0 16px 36px rgba(37, 99, 235, .1);
}
.table-wrap {
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, .8);
  background: #fff;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody tr:hover td {
  background: #f8fbff;
}
.mobile-bottom-nav {
  display: none;
}
@media (max-width: 980px) {
  .screen-toolbelt {
    grid-template-columns: 1fr;
  }
  .screen-checklist-title {
    display: grid;
  }
}
@media (max-width: 760px) {
  body {
    padding-bottom: 72px;
  }
  .topbar {
    padding-bottom: .75rem;
  }
  .mobile-bottom-nav {
    position: fixed;
    left: .75rem;
    right: .75rem;
    bottom: .75rem;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .25rem;
    z-index: 40;
    padding: .35rem;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 22px;
    background: rgba(15, 23, 42, .94);
    box-shadow: 0 16px 44px rgba(15, 23, 42, .28);
    backdrop-filter: blur(14px);
  }
  .mobile-bottom-nav-item {
    display: grid;
    place-items: center;
    gap: .08rem;
    min-height: 48px;
    border-radius: 16px;
    color: rgba(255,255,255,.78);
    font-size: .72rem;
    font-weight: 800;
    text-decoration: none;
  }
  .mobile-bottom-nav-item.active,
  .mobile-bottom-nav-item:focus,
  .mobile-bottom-nav-item:hover {
    background: rgba(255,255,255,.14);
    color: #fff;
    text-decoration: none;
  }
  .mobile-bottom-icon {
    font-size: 1.05rem;
    line-height: 1;
  }
  .function-sibling-rail,
  .status-legend,
  .screen-checklist-card {
    padding: .75rem;
  }
  .page-context-bar {
    margin-bottom: .85rem;
  }
  .table-wrap {
    margin-left: -.25rem;
    margin-right: -.25rem;
  }
}

/* v2.08: premium visual design system refresh
   Goal: make every functional page feel calmer, clearer, and more desirable to use
   without changing business logic. */
:root {
  --bg: #eef3f9;
  --panel: rgba(255, 255, 255, .92);
  --text: #142033;
  --muted: #64748b;
  --line: rgba(148, 163, 184, .28);
  --accent: #2f6fed;
  --accent-dark: #1f4fbc;
  --accent-soft: #eaf2ff;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --ink: #0f172a;
  --surface-glass: rgba(255, 255, 255, .82);
  --surface-raised: #ffffff;
  --shadow-soft: 0 18px 55px rgba(15, 23, 42, .08);
  --shadow-card: 0 12px 34px rgba(15, 23, 42, .07);
  --shadow-hover: 0 22px 50px rgba(37, 99, 235, .14);
  --radius-lg: 18px;
  --radius-xl: 24px;
}
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  line-height: 1.6;
  letter-spacing: .01em;
  background:
    radial-gradient(circle at 0% -10%, rgba(37, 99, 235, .18), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, .12), transparent 28%),
    linear-gradient(180deg, #f7fbff 0%, #eef3f9 44%, #f8fafc 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(15, 23, 42, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), transparent 78%);
}
a { color: #2563eb; }
.topbar {
  background: rgba(12, 20, 35, .88);
  border-bottom: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 14px 44px rgba(15, 23, 42, .2);
  backdrop-filter: blur(18px) saturate(1.2);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .56rem;
  font-size: 1.02rem;
  letter-spacing: .03em;
}
.brand::before {
  content: "K";
  width: 2.05rem;
  height: 2.05rem;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #60a5fa, #2563eb 55%, #1e3a8a);
  color: #fff;
  box-shadow: 0 10px 25px rgba(37, 99, 235, .35);
  font-weight: 950;
}
.global-nav summary,
.global-nav > a,
.nav-quick-link,
.topbar-button {
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.global-nav summary:hover,
.global-nav > a:hover,
.nav-quick-link:hover,
.topbar-button:hover {
  transform: translateY(-1px);
}
.global-nav details[open] {
  box-shadow: 0 18px 42px rgba(15, 23, 42, .24);
  border: 1px solid rgba(255,255,255,.1);
}
.global-nav details[open] > a:hover {
  background: rgba(255,255,255,.12);
  text-decoration: none;
}
.nav-quick-link {
  background: linear-gradient(135deg, rgba(96, 165, 250, .24), rgba(37, 99, 235, .22));
  border-color: rgba(147, 197, 253, .28);
}
.topbar-button {
  background: rgba(255,255,255,.1);
}
.container {
  width: min(1240px, calc(100% - 2rem));
  margin-top: 1.25rem;
}
body.ui-wide .container { width: min(1540px, calc(100% - 2rem)); }
.page-context-shell,
.hero,
.panel,
.card,
.page-card,
.workspace-card,
.readiness-group,
.setup-wizard-group,
.client-action-card,
.document-preview-paper {
  border: 1px solid rgba(148, 163, 184, .24);
  box-shadow: var(--shadow-card);
}
.hero,
.detail-heading,
.first-action-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,246,255,.9)),
    radial-gradient(circle at 80% 0%, rgba(37, 99, 235, .16), transparent 34%);
}
.hero::after,
.detail-heading::after,
.first-action-panel::after {
  content: "";
  position: absolute;
  right: -8rem;
  top: -9rem;
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(59, 130, 246, .16), transparent 68%);
}
.hero h1,
.page-heading h1 {
  color: #0f172a;
  letter-spacing: -.025em;
}
.panel,
.card,
.page-card,
.workspace-card,
.kpi,
.readiness-group,
.setup-wizard-group,
.function-sibling-rail,
.status-legend,
.screen-checklist-card {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
}
.card,
.workspace-card,
.button-link,
button {
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.card:hover,
.workspace-card:hover,
.client-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}
.panel h2,
.card h2,
.workspace-card h2,
.workspace-card h3,
.section-head h2 {
  letter-spacing: -.018em;
  color: #0f172a;
}
.kpi {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96)),
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, .08), transparent 38%);
  border-radius: 18px;
}
.kpi .value {
  color: #0f172a;
  letter-spacing: -.035em;
}
input,
select,
textarea {
  width: 100%;
  background: rgba(255,255,255,.92);
  border-color: rgba(148, 163, 184, .48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, .72);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .13);
  background: #fff;
}
label { color: #334155; }
button,
.button-link {
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .16);
}
button:hover,
.button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(37, 99, 235, .2);
}
button.secondary,
.button-link.secondary {
  box-shadow: none;
  background: rgba(241, 245, 249, .9);
  border-color: rgba(148, 163, 184, .38);
}
button.danger,
.button-link.danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 10px 24px rgba(239, 68, 68, .18);
}
button.success,
.button-link.success {
  background: linear-gradient(135deg, #10b981, #047857);
  box-shadow: 0 10px 24px rgba(16, 185, 129, .18);
}
.toolbar,
.client-form-section,
.document-lines-editor,
.estimate-assist-panel,
.mobile-work-log-step,
.quick-deal-panel {
  background: rgba(248, 250, 252, .86);
  border-color: rgba(148, 163, 184, .28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}
.table-wrap {
  box-shadow: var(--shadow-card);
  overflow: auto;
}
table {
  overflow: hidden;
  border-radius: 14px;
}
th {
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  color: #334155;
  font-weight: 850;
  letter-spacing: .025em;
}
td {
  color: #223047;
}
tbody tr:nth-child(even) td { background: rgba(248, 250, 252, .55); }
tbody tr:hover td { background: #eef6ff; }
.badge {
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 20%, transparent);
  box-shadow: 0 5px 14px rgba(15, 23, 42, .05);
}
.empty-state {
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,250,252,.92)),
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, .08), transparent 42%);
  border-color: rgba(37, 99, 235, .18);
}
.empty-icon {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .16);
}
.page-context-shell {
  background: rgba(255,255,255,.78);
}
.screen-toolbelt > * {
  min-width: 0;
}
.context-chip,
.workspace-quick-link {
  border-radius: 999px;
}
.command-palette,
.modal-card,
.toast {
  border: 1px solid rgba(148, 163, 184, .24);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}
.document-preview-paper {
  background:
    linear-gradient(180deg, #ffffff 0%, #ffffff 72%, #f8fbff 100%);
}
.document-total-hero {
  background: linear-gradient(135deg, #0f172a, #1d4ed8 62%, #0ea5e9);
}
.mobile-bottom-nav {
  border-color: rgba(191, 219, 254, .18);
}
.back-to-top {
  border-radius: 999px;
  box-shadow: 0 16px 42px rgba(37, 99, 235, .26);
}
@media (max-width: 760px) {
  .container { width: min(100% - 1rem, 1240px); }
  .hero,
  .panel,
  .card,
  .page-card,
  .workspace-card { border-radius: 18px; }
  .hero { padding: 1.35rem; }
  .page-heading,
  .section-head { display: grid; }
  .actions { width: 100%; }
  .actions > *,
  .empty-actions > *,
  .button-link,
  button { min-height: 42px; }
  .topbar { gap: .75rem; }
  .brand { font-size: .92rem; }
  .brand::before { width: 1.85rem; height: 1.85rem; border-radius: 12px; }
  .global-nav { gap: .4rem; }
  .nav-quick-link,
  .topbar-button { padding: .36rem .58rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* v2.08: navigation IA refresh for role-based daily work */
.global-nav .nav-section-heading {
  display: block;
  margin: .55rem .65rem .22rem;
  padding-top: .42rem;
  border-top: 1px solid rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .68);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  pointer-events: none;
}
.global-nav details[open] > .nav-section-heading:first-of-type {
  border-top: none;
  padding-top: .18rem;
}
.global-nav details[open] {
  min-width: 13.25rem;
  padding-bottom: .45rem;
}
.global-nav details[open] > a {
  border-radius: 10px;
  margin: 0 .35rem;
}
.global-nav details[open] > a[data-require-role][hidden],
.global-nav details[open] > .nav-section-heading[data-require-role][hidden] {
  display: none;
}
.nav-quick-link[href="/estimate-wizard"] {
  background: linear-gradient(135deg, rgba(34, 197, 94, .24), rgba(14, 165, 233, .20));
  border-color: rgba(125, 211, 252, .32);
}
.role-entry-panel {
  display: grid;
  gap: 1rem;
}
.role-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .9rem;
}
.role-entry-card {
  display: grid;
  gap: .45rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(248,250,252,.78));
  box-shadow: 0 14px 34px rgba(15, 23, 42, .07);
  color: var(--text);
}
.role-entry-card:hover,
.role-entry-card:focus {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .11);
}
.role-entry-icon {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  font-size: 1.15rem;
}
.role-entry-card strong {
  font-size: 1.02rem;
  color: #0f172a;
}
.role-entry-card span:last-child {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}
@media (max-width: 760px) {
  .global-nav details[open] {
    width: min(100%, 23rem);
  }
  .global-nav .nav-section-heading {
    margin-top: .45rem;
  }
  .nav-quick-link[href="/estimate-wizard"] {
    display: none;
  }
  .role-entry-grid {
    grid-template-columns: 1fr;
  }
}

/* v1.99.9: role-based workspace home enhancements */
.role-home-section {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.role-home-tabs {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  padding: .35rem;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.role-home-grid {
  display: grid;
  gap: 1rem;
}
.role-home-card {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(14,165,233,.12), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,250,252,.82));
  box-shadow: 0 20px 48px rgba(15, 23, 42, .08);
  scroll-margin-top: 7rem;
}
.role-home-card.success { border-color: rgba(34,197,94,.24); }
.role-home-card.warning { border-color: rgba(245,158,11,.26); }
.role-home-card.info { border-color: rgba(14,165,233,.25); }
.role-home-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem;
}
.role-home-icon {
  display: inline-grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(219,234,254,.95), rgba(191,219,254,.8));
  box-shadow: 0 12px 28px rgba(37,99,235,.16);
  font-size: 1.45rem;
}
.role-home-hero h2 { margin: 0; }
.role-home-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}
.role-home-list {
  display: grid;
  gap: .45rem;
  min-width: 0;
  padding: .85rem;
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 18px;
  background: rgba(255,255,255,.74);
}
.role-home-list h3 {
  margin: 0;
  font-size: .92rem;
  color: #0f172a;
}
.role-home-list ul {
  display: grid;
  gap: .45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.role-home-list li {
  display: grid;
  gap: .15rem;
  min-width: 0;
  color: #334155;
  font-size: .9rem;
}
.role-home-list li a,
.role-home-list li span {
  overflow-wrap: anywhere;
  font-weight: 800;
}
.role-home-list li small {
  color: #64748b;
  line-height: 1.35;
}
.role-home-action {
  display: grid;
  gap: .1rem;
  padding: .62rem .72rem;
  border-radius: 14px;
  border: 1px solid rgba(203,213,225,.9);
  background: rgba(248,250,252,.92);
  color: #0f172a;
  text-decoration: none;
}
.role-home-action:hover,
.role-home-action:focus {
  transform: translateY(-1px);
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
}
.role-home-action.primary {
  border-color: rgba(59,130,246,.35);
  background: linear-gradient(135deg, rgba(239,246,255,.98), rgba(224,242,254,.82));
}
.role-home-action span {
  color: #64748b;
  font-size: .82rem;
  line-height: 1.35;
}
.workspace-map-section {
  display: grid;
  gap: .9rem;
  margin-top: 1.2rem;
}
@media (max-width: 1120px) {
  .role-home-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .role-home-tabs {
    border-radius: 22px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .role-home-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .role-home-hero .button-link {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }
  .role-home-columns { grid-template-columns: 1fr; }
  .role-home-card { padding: .95rem; border-radius: 20px; }
}


/* v1.99.9: deal detail sticky next-action bar */
.deal-next-action-bar {
  position: sticky;
  top: calc(var(--topbar-height, 72px) + .75rem);
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) auto;
  gap: 1rem;
  align-items: center;
  margin: -0.35rem 0 1.1rem;
  padding: 1rem;
  border: 1px solid rgba(191, 219, 254, .72);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(239,246,255,.90));
  box-shadow: 0 18px 42px rgba(15, 23, 42, .12);
  backdrop-filter: blur(14px);
}
.deal-next-action-bar.danger { border-color: rgba(248, 113, 113, .62); background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(254,242,242,.92)); }
.deal-next-action-bar.warning { border-color: rgba(251, 191, 36, .62); background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,251,235,.92)); }
.deal-next-action-copy { min-width: 0; }
.deal-next-action-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; color: var(--muted); font-size: .84rem; font-weight: 800; }
.deal-next-action-copy h2 { margin: .35rem 0 .2rem; font-size: clamp(1.05rem, 2vw, 1.35rem); }
.deal-next-action-copy p { margin: 0; color: var(--muted); line-height: 1.55; }
.deal-next-action-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; }
.deal-next-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: .6rem .8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .45);
  background: rgba(255,255,255,.78);
  color: var(--text);
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}
.deal-next-action-link:hover { transform: translateY(-1px); text-decoration: none; border-color: rgba(37,99,235,.45); }
.deal-next-action-link.primary { background: linear-gradient(135deg, var(--accent), #0ea5e9); color: #fff; border-color: transparent; }
.deal-next-action-link.primary.danger { background: linear-gradient(135deg, #dc2626, #f97316); }
.deal-next-action-link.primary.warning { background: linear-gradient(135deg, #d97706, #f59e0b); }
@media (max-width: 920px) {
  .deal-next-action-bar { grid-template-columns: 1fr; position: static; }
  .deal-next-action-links { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .deal-next-action-links { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .deal-next-action-link { width: 100%; padding-inline: .65rem; }
  .deal-next-action-link.primary { grid-column: 1 / -1; }
}

/* v2.06 Accounting workbench */
.accounting-hero .hero-actions,
.accounting-next-step-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.accounting-workbench-summary,
.accounting-workbench-close,
.accounting-workbench-section {
  border: 1px solid rgba(30, 64, 175, 0.12);
}
.accounting-workbench-kpis .status-kpi,
.accounting-workbench-kpis .kpi-card {
  min-width: 180px;
}
.accounting-next-step-grid {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.accounting-workbench-grid {
  align-items: start;
}
.accounting-workbench-section .table-wrap,
.accounting-workbench-section table {
  width: 100%;
}
.accounting-workbench-section td,
.accounting-workbench-section th {
  vertical-align: top;
}
.accounting-workbench-close .chip-row {
  margin-top: 0.75rem;
}
@media (max-width: 920px) {
  .accounting-workbench-grid.grid.two {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .accounting-hero .hero-actions,
  .accounting-next-step-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
  .accounting-workbench-section {
    overflow-x: auto;
  }
}

/* v2.06 accounting monthly task progress */
.accounting-monthly-tasks-panel {
  overflow: hidden;
}
.accounting-monthly-task-kpis {
  margin: 1rem 0;
}
.accounting-monthly-task-group {
  margin-top: 1.25rem;
}
.accounting-monthly-task-group h3 {
  margin: 0 0 0.75rem;
  color: var(--text, #0f172a);
}
.accounting-monthly-task-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.9rem;
}
.accounting-monthly-task {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(148,163,184,0.24);
  box-shadow: 0 14px 30px rgba(15,23,42,0.08);
}
.accounting-monthly-task.danger {
  border-color: rgba(220, 38, 38, 0.28);
}
.accounting-monthly-task.warning {
  border-color: rgba(217, 119, 6, 0.28);
}
.accounting-monthly-task.success {
  border-color: rgba(22, 163, 74, 0.26);
}
.accounting-monthly-task-main {
  display: grid;
  gap: 0.6rem;
}
.accounting-monthly-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.accounting-monthly-task-actions .button-link,
.accounting-monthly-task-actions button {
  min-height: 36px;
}
@media (max-width: 640px) {
  .accounting-monthly-task-list {
    grid-template-columns: 1fr;
  }
  .accounting-monthly-task-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .accounting-monthly-task-actions .button-link {
    text-align: center;
  }
}

/* v2.06 Accounting monthly report and close-check polish */
.monthly-close-check-output {
  margin: 0.85rem 0 0;
}
.monthly-close-check-panel {
  border-radius: 20px;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}
.monthly-close-check-panel.danger {
  border-color: rgba(239, 68, 68, 0.28);
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.96), rgba(255, 255, 255, 0.9));
}
.monthly-close-check-panel.warning {
  border-color: rgba(245, 158, 11, 0.32);
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.9));
}
.monthly-close-check-panel.success {
  border-color: rgba(34, 197, 94, 0.28);
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.96), rgba(255, 255, 255, 0.9));
}
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0;
}
.check-row + .check-row {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}
.accounting-monthly-tasks-panel .section-header .actions {
  align-items: center;
  justify-content: flex-end;
}
@media (max-width: 760px) {
  .accounting-monthly-tasks-panel .section-header .actions {
    width: 100%;
    justify-content: stretch;
  }
  .accounting-monthly-tasks-panel .section-header .actions > * {
    flex: 1 1 100%;
  }
}

/* v2.08: accounting monthly close report snapshots */
.monthly-close-report-snapshots {
  margin-top: 1rem;
}

.monthly-close-snapshot-panel {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(239, 246, 255, 0.86));
}

.monthly-close-snapshot-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}

.monthly-close-snapshot-card {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.monthly-close-snapshot-card.ready {
  border-color: rgba(34, 197, 94, 0.32);
}

.monthly-close-snapshot-card.blocked {
  border-color: rgba(239, 68, 68, 0.28);
}

.monthly-close-snapshot-card .actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .monthly-close-snapshot-list {
    grid-template-columns: 1fr;
  }
  .monthly-close-snapshot-card .actions > * {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* v2.06 Smart Start */
.smart-start-trigger {
  border: 0;
  cursor: pointer;
  font: inherit;
}
.smart-start-overlay .modal-card {
  max-width: min(920px, calc(100vw - 32px));
}
.smart-start-modal {
  overflow: hidden;
}
.smart-start-title {
  padding: 4px 4px 10px;
}
.smart-start-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent, #2563eb);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.smart-start-body {
  margin-top: 12px;
}
.smart-start-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.smart-start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.smart-start-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  text-align: left;
  padding: 16px;
  min-height: 116px;
  border: 1px solid rgba(37, 99, 235, .14);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(239,246,255,.86));
  color: inherit;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.smart-start-card:hover,
.smart-start-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, .42);
  box-shadow: 0 20px 46px rgba(37, 99, 235, .14);
  outline: none;
}
.smart-start-card.primary {
  background: linear-gradient(145deg, rgba(37, 99, 235, .96), rgba(14, 165, 233, .9));
  color: #fff;
}
.smart-start-card small {
  display: block;
  margin-top: 6px;
  color: inherit;
  opacity: .78;
  line-height: 1.45;
}
.smart-start-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
  font-size: 1.35rem;
}
.smart-start-card.primary .smart-start-icon {
  background: rgba(255,255,255,.18);
}
@media (max-width: 760px) {
  .smart-start-overlay .modal-card {
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    overflow: auto;
  }
  .smart-start-grid {
    grid-template-columns: 1fr;
  }
  .smart-start-card {
    min-height: auto;
  }
}

/* v2.08: quick deal duplicate and quality guidance */
.duplicate-warning-panel,
.deal-quality-warnings,
.quick-create-next-actions {
  margin-top: var(--space-4, 1rem);
  padding: var(--space-4, 1rem);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-lg, 16px);
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.95), rgba(255, 247, 237, 0.8));
}
.duplicate-candidate-list,
.warning-list,
.quick-create-next-grid {
  display: grid;
  gap: .75rem;
  margin-top: .75rem;
}
.duplicate-candidate-card,
.warning-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 14px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}
.warning-card.info { border-color: rgba(59, 130, 246, .18); }
.warning-card.warning { border-color: rgba(245, 158, 11, .24); }
.quick-create-next-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.quick-create-success {
  display: block;
}
.quick-deal-panel .inline-guide,
.quick-deal-panel .empty-hint {
  max-width: 68ch;
}
@media (max-width: 760px) {
  .duplicate-candidate-card,
  .warning-card {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* v2.08: estimate wizard recommendation panel */
.wizard-recommendation {
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(14, 165, 233, 0.08)), rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}
.wizard-recommendation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, max-content);
  gap: 1rem;
  align-items: center;
}
.wizard-recommendation-card .recommendation-main {
  display: grid;
  gap: 0.35rem;
}
.wizard-recommendation-card .recommendation-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 40%;
  min-width: 0;
  flex-shrink: 0;
}
.wizard-recommendation-card .recommendation-meta .button,
.wizard-recommendation-card .recommendation-meta button {
  white-space: nowrap;
}
.recommendation-alternatives {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 0.3rem;
}
.wizard-method-card.active {
  border-color: rgba(37, 99, 235, 0.72);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16), 0 14px 34px rgba(37, 99, 235, 0.16);
  transform: translateY(-1px);
}
@media (max-width: 760px) {
  .wizard-recommendation-card {
    grid-template-columns: 1fr;
  }
  .wizard-recommendation-card .recommendation-meta {
    justify-content: flex-start;
  }
}

/* v2.08: estimate wizard sticky live summary */
.estimate-wizard-form {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "progress progress"
    "step summary"
    "actions summary";
  align-items: start;
}
.estimate-wizard-form > .wizard-progress {
  grid-area: progress;
}
.estimate-wizard-form > .wizard-actions {
  grid-area: actions;
}
.estimate-wizard-form > .wizard-recommendation,
.estimate-wizard-form > .client-knowledge-panel,
.estimate-wizard-form > .wizard-assist-zone,
.estimate-wizard-form > #estimate-wizard-review,
.estimate-wizard-form > #estimate-wizard-result {
  grid-column: 1 / -1;
  min-width: 0;
}
.estimate-wizard-form > .wizard-step {
  grid-area: step;
  min-width: 0;
  display: block;
  container-type: inline-size;
  container-name: wizard-step;
}
.wizard-step[hidden] { display: none !important; }
.estimate-wizard-live-summary {
  grid-area: summary;
  position: sticky;
  top: calc(var(--topbar-height) + 16px);
  align-self: start;
  min-width: 0;
}
.wizard-live-summary-card {
  display: grid;
  gap: .85rem;
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 22px;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(248,250,252,.92));
  box-shadow: 0 18px 42px rgba(15, 23, 42, .10);
}
.summary-card-head {
  display: grid;
  gap: .25rem;
}
.summary-card-head strong {
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  color: #0f172a;
  line-height: 1;
}
.summary-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .55rem;
}
.summary-metric-grid .kpi {
  padding: .65rem;
  font-size: .82rem;
  min-width: 0;
}
.summary-metric-grid .kpi .value {
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.summary-profit-box {
  display: grid;
  gap: .45rem;
  border-radius: 16px;
  padding: .75rem;
  background: rgba(37, 99, 235, .06);
  border: 1px solid rgba(37, 99, 235, .12);
}
.summary-profit-box > div {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: baseline;
}
.summary-profit-box span {
  color: var(--muted, #64748b);
  font-size: .86rem;
}
.summary-signal-list {
  display: grid;
  gap: .45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.summary-signal {
  border-radius: 12px;
  padding: .55rem .65rem;
  background: #f8fafc;
  color: #334155;
  border: 1px solid rgba(148, 163, 184, .35);
  font-size: .9rem;
}
.summary-signal.warning { background: #fffbeb; border-color: rgba(245, 158, 11, .32); color: #92400e; }
.summary-signal.danger { background: #fef2f2; border-color: rgba(239, 68, 68, .28); color: #991b1b; }
.summary-signal.success { background: #ecfdf5; border-color: rgba(16, 185, 129, .28); color: #065f46; }
.summary-signal.info { background: #eff6ff; border-color: rgba(59, 130, 246, .28); color: #1e40af; }
.notice.compact {
  padding: .6rem .7rem;
  font-size: .9rem;
}
@media (max-width: 1080px) {
  .estimate-wizard-form {
    grid-template-columns: 1fr;
    grid-template-areas:
      "progress"
      "summary"
      "step"
      "actions";
  }
  .estimate-wizard-live-summary {
    position: static;
  }
}
@media (max-width: 640px) {
  .summary-metric-grid {
    grid-template-columns: 1fr;
  }
  .wizard-live-summary-card {
    border-radius: 18px;
    padding: .85rem;
  }
}

/* v2.08: work-log follow-up actions */
.work-log-success-panel {
  border: 1px solid rgba(16, 185, 129, 0.24);
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.96), rgba(255, 255, 255, 0.9));
}
.work-log-followup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.work-log-followup-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-height: 128px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
.work-log-followup-card.primary {
  border-color: rgba(37, 99, 235, 0.28);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.9));
}
.work-log-followup-slot {
  margin-top: 12px;
}
@media (max-width: 760px) {
  .work-log-followup-grid {
    grid-template-columns: 1fr;
  }
  .work-log-success-panel .success-box {
    text-align: left;
  }
}

/* v2.09: estimate wizard client knowledge */
.client-knowledge-panel {
  margin-top: 1rem;
}
.estimate-knowledge-card {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 20px;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.92), rgba(255,255,255,0.96));
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}
.knowledge-empty {
  border: 1px dashed rgba(100, 116, 139, 0.35);
  border-radius: 16px;
  padding: 1rem;
  background: rgba(248, 250, 252, 0.72);
}
.knowledge-signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: flex-end;
}
.knowledge-note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
  margin-top: .75rem;
}
.knowledge-note-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  padding: .85rem;
  background: rgba(255,255,255,0.9);
}
.knowledge-note-card.tone-warning {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.95), rgba(255,255,255,0.94));
}
.knowledge-note-card.tone-info {
  border-color: rgba(14, 165, 233, 0.35);
  background: linear-gradient(180deg, rgba(240, 249, 255, 0.95), rgba(255,255,255,0.94));
}
.knowledge-note-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .45rem;
}
.knowledge-history {
  margin-top: .8rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  padding-top: .65rem;
}
.knowledge-history summary {
  cursor: pointer;
  font-weight: 700;
}
.knowledge-history ul {
  margin: .5rem 0 0;
  padding-left: 1.1rem;
}
.status-badge.signal-warning { background: #fef3c7; color: #92400e; }
.status-badge.signal-info { background: #dbeafe; color: #1e40af; }
.status-badge.signal-muted { background: #e5e7eb; color: #374151; }

@media (max-width: 720px) {
  .knowledge-signal-row { justify-content: flex-start; }
  .knowledge-note-grid { grid-template-columns: 1fr; }
}

/* v2.10: estimate submission readiness / save success polish */
.estimate-wizard-success {
  display: grid;
  gap: var(--space-4, 1rem);
  border: 1px solid rgba(16, 185, 129, 0.28);
  background:
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(236, 253, 245, 0.96), rgba(255, 255, 255, 0.96));
}
.estimate-wizard-success .success-hero {
  display: grid;
  gap: 0.35rem;
}
.estimate-wizard-success .success-hero strong {
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  color: var(--ink-900, #0f172a);
}
.next-action-grid.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.status-badge.success,
.badge.success {
  border-color: rgba(16, 185, 129, 0.35);
}
@media (max-width: 640px) {
  .next-action-grid.compact {
    display: grid;
    grid-template-columns: 1fr;
  }
  .next-action-grid.compact .button,
  .next-action-grid.compact .button-link,
  .next-action-grid.compact button {
    width: 100%;
    justify-content: center;
  }
}

/* v2.10.2: responsive polish for document line editors across estimates/invoices/wizard */
.document-line-row {
  box-sizing: border-box;
}
.document-line-row .line-service-item,
.document-line-row .line-description {
  min-width: 0;
}
.document-line-row .line-service-item select,
.document-line-row .line-description input {
  width: 100%;
}
@media (max-width: 1100px) {
  .document-lines:not(.compact-inline-lines) {
    overflow-x: visible;
  }
  .document-line-row:not(.compact-inline-line) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }
  .document-line-row:not(.compact-inline-line) .line-service-item,
  .document-line-row:not(.compact-inline-line) .line-description,
  .document-line-row:not(.compact-inline-line) .line-calculated {
    grid-column: 1 / -1;
  }
  .document-line-row:not(.compact-inline-line) .line-calculated {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem .6rem;
    border-radius: 12px;
    background: rgba(248, 250, 252, .86);
  }
  .document-line-toolbar {
    align-items: stretch;
  }
  .document-line-toolbar .document-line-totals {
    flex: 1 1 220px;
    overflow-wrap: anywhere;
  }
}
@media (max-width: 640px) {
  .document-line-row:not(.compact-inline-line) {
    grid-template-columns: 1fr;
  }
  .document-line-row:not(.compact-inline-line) .icon-button {
    width: 100%;
    min-width: 0;
  }
  .document-line-toolbar {
    display: grid;
    gap: .65rem;
  }
  .document-line-toolbar button,
  .document-line-toolbar .button,
  .document-line-toolbar .button-link {
    width: 100%;
    justify-content: center;
  }
}

/* v2.11: ad-hoc estimate/invoice lines can optionally be promoted to the service master. */
.line-master-save {
  grid-column: 1 / -1;
  border: 1px dashed rgba(37, 99, 235, 0.28);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  background: rgba(239, 246, 255, 0.72);
}
.line-master-save-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  color: #1e3a8a;
  cursor: pointer;
}
.line-master-save-toggle input {
  width: auto;
}
.line-master-save-fields {
  display: none;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.7fr) minmax(200px, 1fr);
  gap: 0.75rem;
  margin-top: 0.7rem;
}
.line-master-save.is-open .line-master-save-fields {
  display: grid;
}
.line-master-save.is-disabled {
  opacity: 0.58;
}
.line-master-save-hint {
  margin: 0.45rem 0 0;
}
@media (max-width: 720px) {
  .line-master-save-fields {
    grid-template-columns: 1fr;
  }
}

/* v2.12: sales forecast cockpit visualizations. */
.forecast-hero {
  align-items: flex-start;
}
.forecast-control-panel {
  position: relative;
  overflow: visible;
}
.sticky-forecast-toolbar {
  position: sticky;
  top: 72px;
  z-index: 4;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  padding: 0.75rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}
.forecast-kpis .kpi {
  min-height: 132px;
}
.forecast-cockpit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 1rem;
  margin: 1rem 0;
}
.forecast-cockpit-grid .wide {
  grid-column: span 1;
}
.forecast-chart-card {
  min-width: 0;
  overflow: hidden;
}
.forecast-chart-root {
  min-height: 210px;
}
.forecast-bar-chart,
.forecast-owner-chart {
  display: grid;
  gap: 0.8rem;
}
.forecast-bar-row {
  display: grid;
  gap: 0.35rem;
}
.forecast-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
}
.forecast-bar-label {
  font-weight: 800;
  color: #0f172a;
  overflow-wrap: anywhere;
}
.forecast-bar-value,
.forecast-bar-subvalue {
  color: #475569;
  font-size: 0.86rem;
  white-space: nowrap;
}
.forecast-bar-track {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.88);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
}
.forecast-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #22c55e);
}
.forecast-bar-fill.commit { background: linear-gradient(90deg, #0f766e, #14b8a6); }
.forecast-bar-fill.best_case { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.forecast-bar-fill.pipeline { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.forecast-bar-fill.omitted { background: linear-gradient(90deg, #64748b, #94a3b8); }
.forecast-bar-fill.warning { background: linear-gradient(90deg, #f97316, #facc15); }
.forecast-bar-fill.success { background: linear-gradient(90deg, #16a34a, #86efac); }
.forecast-bar-fill.secondary-fill {
  top: 4px;
  height: 8px;
  opacity: .62;
  background: rgba(15, 23, 42, .55);
}
.forecast-owner-row {
  display: grid;
  gap: 0.4rem;
}
.forecast-owner-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.forecast-quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
}
.forecast-quality-card {
  border: 1px solid rgba(251, 191, 36, 0.34);
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.9));
  border-radius: 18px;
  padding: 0.9rem;
  box-shadow: 0 10px 22px rgba(146, 64, 14, 0.08);
}
.forecast-quality-top {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.45rem;
}
.forecast-quality-title {
  display: inline-block;
  font-weight: 850;
  color: #1d4ed8;
  margin-bottom: .35rem;
  text-decoration: none;
}
.success-state.compact,
.empty-state.compact {
  border-radius: 16px;
  padding: 1rem;
  background: rgba(240, 253, 244, 0.85);
  color: #166534;
  font-weight: 750;
}
.empty-state.compact {
  background: rgba(248, 250, 252, .9);
  color: #475569;
}
@media (max-width: 1100px) {
  .forecast-cockpit-grid {
    grid-template-columns: 1fr;
  }
  .sticky-forecast-toolbar {
    position: static;
  }
}
@media (max-width: 640px) {
  .forecast-bar-meta {
    display: grid;
  }
  .forecast-chart-root {
    min-height: auto;
  }
  .forecast-kpis .kpi {
    min-height: 108px;
  }
}

/* v2.13: sales forecast drilldown and tab UI */
.forecast-tabs {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: .35rem;
  margin: .75rem 0 1rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, .06);
  border: 1px solid rgba(148, 163, 184, .24);
}
.forecast-tab {
  border: 0;
  border-radius: 999px;
  padding: .65rem 1rem;
  background: transparent;
  color: #475569;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.forecast-tab:hover,
.forecast-tab:focus-visible {
  background: rgba(255, 255, 255, .82);
  color: #1d4ed8;
}
.forecast-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
  box-shadow: 0 12px 24px rgba(29, 78, 216, .18);
}
.forecast-tab-panel[hidden] {
  display: none !important;
}
.forecast-filter-bar {
  margin-top: .9rem;
  padding: .75rem .85rem;
  border-radius: 18px;
  display: flex;
  gap: .55rem;
  align-items: center;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(239, 246, 255, .92), rgba(240, 253, 250, .9));
  border: 1px solid rgba(37, 99, 235, .18);
}
.forecast-filter-label {
  font-weight: 900;
  color: #1e3a8a;
  letter-spacing: .02em;
}
.forecast-bar-row.is-clickable,
.forecast-quality-card.is-clickable {
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.forecast-bar-row.is-clickable:hover,
.forecast-bar-row.is-clickable:focus-visible,
.forecast-quality-card.is-clickable:hover,
.forecast-quality-card.is-clickable:focus-visible {
  transform: translateY(-2px);
  outline: none;
  box-shadow: 0 16px 28px rgba(15, 23, 42, .12);
}
.forecast-bar-row.is-clickable:hover .forecast-bar-label,
.forecast-bar-row.is-clickable:focus-visible .forecast-bar-label {
  color: #1d4ed8;
}
.forecast-chart-card .forecast-bar-row.is-clickable::after {
  content: 'クリックで絞り込み';
  width: max-content;
  max-width: 100%;
  font-size: .72rem;
  color: #64748b;
}
@media (max-width: 640px) {
  .forecast-tabs {
    border-radius: 18px;
  }
  .forecast-tab {
    padding: .6rem .8rem;
  }
  .forecast-filter-bar {
    align-items: flex-start;
  }
}

/* v2.14: sales forecast goal and snapshot comparison */
.forecast-goal-comparison,
.forecast-snapshot-comparison {
  margin-top: 1rem;
}
.forecast-goal-card,
.forecast-snapshot-card {
  border: 1px solid rgba(79, 70, 229, 0.14);
  border-radius: 22px;
  padding: 1.1rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.94), rgba(239,246,255,0.78));
  box-shadow: var(--shadow-soft, 0 12px 28px rgba(15, 23, 42, 0.08));
}
.forecast-goal-card.gap {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(255,251,235,0.96), rgba(255,255,255,0.85));
}
.forecast-goal-card.commit-covers,
.forecast-goal-card.best-case-covers,
.forecast-goal-card.weighted-covers {
  border-color: rgba(16, 185, 129, 0.32);
  background: linear-gradient(135deg, rgba(236,253,245,0.96), rgba(255,255,255,0.85));
}
.forecast-goal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.forecast-goal-head h3 {
  margin: 0.1rem 0;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}
.forecast-goal-bars {
  display: grid;
  gap: 0.7rem;
}
.forecast-goal-bar-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 2fr) auto;
  align-items: center;
  gap: 0.75rem;
}
.forecast-goal-bar-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.forecast-goal-bar-label span,
.forecast-goal-percent {
  color: var(--muted, #64748b);
  font-size: 0.86rem;
}
.forecast-goal-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}
.forecast-goal-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
}
.forecast-goal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
  color: var(--muted, #64748b);
  font-size: 0.9rem;
}
.forecast-delta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.7rem;
}
.forecast-delta-card {
  border-radius: 16px;
  padding: 0.85rem;
  background: rgba(248, 250, 252, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.18);
}
.forecast-delta-card span {
  display: block;
  color: var(--muted, #64748b);
  font-size: 0.82rem;
}
.forecast-delta-card strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.05rem;
}
.forecast-delta-card.success strong,
.delta-pill.success { color: #047857; }
.forecast-delta-card.danger strong,
.delta-pill.danger { color: #b91c1c; }
.forecast-delta-card.muted strong,
.delta-pill.muted { color: #475569; }
.delta-pill {
  font-weight: 700;
  white-space: nowrap;
}
.muted-card {
  background: linear-gradient(135deg, rgba(248,250,252,0.94), rgba(241,245,249,0.86));
}
@media (max-width: 760px) {
  .forecast-goal-head,
  .forecast-goal-foot {
    display: block;
  }
  .forecast-goal-bar-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .forecast-goal-percent {
    justify-self: start;
  }
}


/* v2.15 sales forecast goal/action enhancements */
.forecast-goal-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  padding: 1rem;
  margin: 1rem 0;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.9));
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}
.forecast-goal-editor[hidden] {
  display: none;
}
.forecast-goal-editor label {
  min-width: 180px;
  flex: 1 1 220px;
}
.forecast-action-recommendations {
  margin-top: 1rem;
}
.forecast-action-panel {
  padding: 1.1rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}
.forecast-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
}
.forecast-action-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.forecast-action-card.danger {
  border-color: rgba(220, 38, 38, 0.3);
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.95), rgba(255, 255, 255, 0.95));
}
.forecast-action-card.warning {
  border-color: rgba(217, 119, 6, 0.32);
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.95), rgba(255, 255, 255, 0.95));
}
.forecast-action-card.success {
  border-color: rgba(22, 163, 74, 0.28);
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.95), rgba(255, 255, 255, 0.95));
}
.forecast-important-changes {
  margin-top: 1rem;
}
.forecast-important-change-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
}
.forecast-important-change {
  padding: 0.8rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.9);
}
.forecast-important-change span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}
.forecast-important-change strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.05rem;
}
@media (max-width: 720px) {
  .forecast-goal-editor {
    align-items: stretch;
  }
  .forecast-goal-editor button,
  .forecast-goal-editor .button-link {
    width: 100%;
  }
}


/* v2.16 sales forecast action execution */
.forecast-follow-up-panel {
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.82));
}
.forecast-follow-up-list {
  display: grid;
  gap: 0.85rem;
}
.forecast-follow-up-card {
  display: grid;
  grid-template-columns: minmax(80px, 100px) 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
}
.forecast-follow-up-card.high {
  border-color: rgba(220, 38, 38, 0.3);
  background: linear-gradient(135deg, rgba(254, 242, 242, 0.96), rgba(255, 255, 255, 0.92));
}
.forecast-follow-up-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--text);
}
.forecast-follow-up-body {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}
.forecast-follow-up-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.forecast-follow-up-title {
  font-weight: 800;
  font-size: 1.02rem;
}
.forecast-follow-up-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
@media (max-width: 720px) {
  .forecast-follow-up-card {
    grid-template-columns: 1fr;
  }
  .forecast-follow-up-check {
    padding: 0.35rem 0.5rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    width: fit-content;
  }
}

/* v2.17 sales forecast follow-up progress */
.forecast-follow-up-progress {
  display: grid;
  gap: 1rem;
}
.forecast-follow-up-progress .compact-table {
  font-size: 0.9rem;
}
.forecast-follow-up-progress .grid.two-columns {
  align-items: start;
}
@media (max-width: 900px) {
  .forecast-follow-up-progress .grid.two-columns {
    grid-template-columns: 1fr;
  }
}

/* v2.18 executive reporting visual refresh */
:root {
  --executive-navy: #0F172A;
  --executive-slate: #1E293B;
  --executive-line: #E2E8F0;
  --executive-soft: #F8FAFC;
  --executive-accent: #3B82F6;
  --executive-cyan: #06B6D4;
  --executive-success: #22C55E;
  --executive-warning: #F59E0B;
  --executive-danger: #EF4444;
}
body {
  background:
    radial-gradient(circle at top left, rgba(59,130,246,0.13), transparent 34rem),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}
body.theme-dark {
  --bg: #0F172A;
  --panel: #1E293B;
  --text: #F8FAFC;
  --muted: #CBD5E1;
  --line: rgba(148,163,184,0.28);
  --primary: #60A5FA;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --color-primary: var(--primary);
  --color-success: var(--success);
  --color-warning: var(--warning);
  --color-danger: var(--danger);
  --color-border: rgba(148,163,184,0.28);
  --color-surface: #1E293B;
  --color-surface-muted: #0F172A;
  --border-color: var(--color-border);
  --surface: var(--color-surface);
  --surface-muted: var(--color-surface-muted);
  --muted-color: var(--muted);
  --surface-color: var(--surface);
  --muted-surface: var(--surface-muted);
  --muted-text: var(--muted-color);
  background:
    radial-gradient(circle at top left, rgba(59,130,246,0.2), transparent 32rem),
    linear-gradient(180deg, #0F172A 0%, #111827 100%);
  color: #F8FAFC;
}
body.theme-dark .card,
body.theme-dark .panel,
body.theme-dark .executive-chart-card,
body.theme-dark .executive-kpi-panel,
body.theme-dark .executive-insight-card,
body.theme-dark .role-entry-card,
body.theme-dark .kpi {
  background: rgba(30,41,59,0.88);
  border-color: rgba(148,163,184,0.25);
  color: #F8FAFC;
}
body.theme-dark table,
body.theme-dark th {
  background: rgba(15,23,42,0.72);
  color: #F8FAFC;
}
body.theme-dark td,
body.theme-dark th { border-color: rgba(148,163,184,0.25); }
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  background: rgba(15,23,42,0.72);
  color: #F8FAFC;
  border-color: rgba(148,163,184,0.35);
}
.executive-hero {
  position: relative;
  overflow: hidden;
  color: #F8FAFC;
  background:
    linear-gradient(135deg, rgba(15,23,42,0.98), rgba(30,41,59,0.94)),
    radial-gradient(circle at 80% 15%, rgba(59,130,246,0.46), transparent 20rem);
  border: 0;
  box-shadow: 0 28px 80px rgba(15,23,42,0.22);
}
.executive-hero p { color: rgba(248,250,252,0.78); }
.executive-report-shell {
  display: grid;
  gap: 1.1rem;
  margin-bottom: 1.6rem;
}
.executive-insight-card,
.executive-kpi-panel,
.executive-chart-card {
  border-radius: 24px;
  border: 1px solid rgba(226,232,240,0.82);
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
.executive-insight-card { padding: 1.4rem; }
.executive-insight-content {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 1.2rem;
  align-items: center;
}
.executive-insight-card .eyebrow,
.executive-chart-card .eyebrow,
.executive-kpi-panel .eyebrow {
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .74rem;
  color: var(--executive-accent);
  font-weight: 900;
}
.executive-insight-card h2 { margin: .2rem 0 .5rem; font-size: clamp(1.45rem, 2.4vw, 2.1rem); }
.executive-insight-body { color: var(--muted); max-width: 68ch; }
.executive-insight-side ul { margin: .7rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.executive-kpi-panel { padding: 1.15rem; }
.executive-kpis { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.executive-kpis .kpi {
  min-height: 132px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.92));
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  transition: transform .18s ease, box-shadow .18s ease;
}
.executive-kpis .kpi:hover,
.executive-chart-card:hover,
.executive-rank-card:hover { transform: translateY(-3px); box-shadow: 0 18px 46px rgba(15,23,42,0.14); }
.executive-kpis .kpi .value { font-size: clamp(1.45rem, 2.5vw, 2.15rem); letter-spacing: -.04em; color: var(--executive-navy); }
body.theme-dark .executive-kpis .kpi .value { color: #F8FAFC; }
.executive-trend-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, .8fr);
  gap: 1.1rem;
}
.executive-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}
.executive-chart-card { padding: 1.15rem; }
.executive-chart-card h2 { margin-top: .15rem; }
.premium-chart-wrap { display: grid; gap: .5rem; }
.premium-line-chart { width: 100%; min-height: 260px; overflow: visible; }
.chart-grid-line { stroke: rgba(148,163,184,.25); stroke-width: 1; }
.premium-line { stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 6px 12px rgba(59,130,246,.16)); }
.premium-line.accent { stroke: var(--executive-accent); }
.premium-line.cyan { stroke: var(--executive-cyan); }
.premium-line.success { stroke: var(--executive-success); }
.premium-area { opacity: .11; }
.premium-area.accent { fill: var(--executive-accent); }
.premium-point { stroke: #fff; stroke-width: 2; }
.premium-point.accent { fill: var(--executive-accent); }
.premium-point.cyan { fill: var(--executive-cyan); }
.premium-point.success { fill: var(--executive-success); }
.chart-axis-labels,
.premium-chart-legend { display: flex; justify-content: space-between; gap: .75rem; color: var(--muted); font-size: .78rem; }
.premium-chart-legend { justify-content: flex-start; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: .35rem; font-weight: 800; }
.legend-item i { width: .7rem; height: .7rem; border-radius: 50%; background: currentColor; }
.legend-item.accent { color: var(--executive-accent); }
.legend-item.cyan { color: var(--executive-cyan); }
.legend-item.success { color: var(--executive-success); }
.premium-bar-list { display: grid; gap: .7rem; }
.premium-bar-row {
  display: grid;
  gap: .38rem;
  width: 100%;
  color: inherit;
  border: 0;
  background: transparent;
  padding: .15rem 0;
  text-align: left;
}
.premium-bar-row:hover { background: transparent; }
.premium-bar-meta { display: flex; justify-content: space-between; gap: .8rem; font-size: .9rem; }
.premium-bar-track { height: 13px; border-radius: 999px; background: #E2E8F0; overflow: hidden; }
.premium-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--executive-accent), var(--executive-cyan)); }
.executive-ranking-cards { display: grid; gap: .7rem; }
.executive-rank-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: .85rem;
  align-items: center;
  padding: .85rem;
  border-radius: 18px;
  border: 1px solid var(--executive-line);
  background: rgba(248,250,252,.72);
  transition: transform .18s ease, box-shadow .18s ease;
}
.rank-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--executive-navy), var(--executive-accent));
  font-weight: 900;
  letter-spacing: .04em;
}
.executive-review-cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .75rem; }
.executive-detail-table table th { background: #F8FAFC; color: #334155; }
.executive-detail-table tbody tr:hover { background: #F1F5F9; }
@media (max-width: 980px) {
  .executive-insight-content,
  .executive-trend-grid,
  .executive-analysis-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .executive-chart-card,
  .executive-kpis .kpi,
  .executive-rank-card { animation: executiveFadeIn .5s ease both; }
  @keyframes executiveFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
}

/* v2.19 cross-report executive visual polish */
.executive-ops-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 18%, rgba(59, 130, 246, 0.18), transparent 34%),
    radial-gradient(circle at 86% 12%, rgba(6, 182, 212, 0.14), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88));
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}
.theme-dark .executive-ops-hero {
  background:
    radial-gradient(circle at 16% 18%, rgba(59, 130, 246, 0.22), transparent 34%),
    radial-gradient(circle at 86% 12%, rgba(6, 182, 212, 0.14), transparent 30%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.86));
  border-color: rgba(148, 163, 184, 0.22);
}
.compact-reporting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.accounting-executive-shell {
  margin-bottom: 1rem;
}
.executive-kpi-panel.compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem;
}
.executive-mini-metric {
  min-height: 118px;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.executive-mini-metric:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}
.theme-dark .executive-mini-metric {
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(148, 163, 184, 0.18);
}
.executive-mini-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.executive-mini-metric strong {
  display: block;
  margin: 0.45rem 0 0.25rem;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  color: var(--text);
}
.executive-mini-metric small {
  color: var(--muted);
}
.accounting-trend-card {
  margin-bottom: 1rem;
}
.readiness-stepbar-shell {
  margin-top: 1.25rem;
}
.executive-stepbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.executive-step {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 82px;
  padding: 0.8rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.84);
}
.theme-dark .executive-step {
  background: rgba(30, 41, 59, 0.82);
}
.executive-step .step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  font-weight: 800;
  background: #0f172a;
  color: #f8fafc;
}
.executive-step.ok .step-index,
.executive-step.success .step-index { background: #22c55e; }
.executive-step.warning .step-index { background: #f59e0b; }
.executive-step.blocker .step-index,
.executive-step.danger .step-index { background: #ef4444; }
.executive-step strong {
  display: block;
  font-size: 0.92rem;
}
.executive-step small {
  color: var(--muted);
}
.estimate-approval-dashboard .executive-chart-card,
.compact-reporting-grid .executive-chart-card {
  min-height: 260px;
}
.theme-dark .executive-chart-card,
.theme-dark .forecast-chart-card,
.theme-dark .executive-insight-card {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.18);
}
@media (max-width: 720px) {
  .executive-kpi-panel.compact,
  .executive-stepbar,
  .compact-reporting-grid {
    grid-template-columns: 1fr;
  }
}

/* v2.19 executive reporting visual refresh */


/* v2.20 executive report sharing/export */
.executive-report-actions {
  justify-content: flex-end;
  margin: 0 0 1rem;
}
.executive-report-heading {
  align-items: flex-end;
}
.executive-share-page {
  display: grid;
  gap: 1.2rem;
}
.executive-print-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 1.2rem;
}
.executive-chart-root {
  min-height: 260px;
}
.executive-report-heading .button-row {
  flex-wrap: wrap;
}
@media (max-width: 980px) {
  .executive-print-grid {
    grid-template-columns: 1fr;
  }
}
@media print {
  .topbar,
  .mobile-bottom-nav,
  .page-heading .button-row,
  .screen-toolbelt,
  .function-sibling-rail,
  .status-legend,
  .screen-checklist-card {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #0f172a !important;
  }
  main {
    padding: 0 !important;
    max-width: none !important;
  }
  .executive-insight-card,
  .executive-chart-card,
  .kpi-card,
  .card,
  .panel {
    box-shadow: none !important;
    break-inside: avoid;
    border-color: #e2e8f0 !important;
  }
  .executive-print-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* v2.20 executive reporting visual refresh */


/* v2.21 Executive Report snapshot history */
.executive-snapshot-section {
  margin-top: 1.5rem;
}
.executive-snapshot-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.executive-snapshot-card {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.executive-snapshot-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.12);
}
.executive-snapshot-metrics {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
}
[data-theme="dark"] .executive-snapshot-card {
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(148, 163, 184, 0.25);
}
@media print {
  .executive-snapshot-section,
  .executive-report-heading .button-row,
  #global-nav,
  .mobile-bottom-nav {
    display: none !important;
  }
}


/* v2.22 Executive Report comment/approval workflow */
.executive-snapshot-workflow,
.executive-snapshot-comments-card {
  margin-top: 1rem;
}
.executive-workflow-panel {
  display: grid;
  gap: 1rem;
}
.executive-workflow-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr minmax(160px, 0.5fr);
  gap: 0.85rem;
  align-items: end;
}
.executive-comment-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}
.executive-comment-card {
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.9);
}
.executive-comment-card.decision {
  border-color: rgba(34, 197, 94, 0.25);
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.92), rgba(255, 255, 255, 0.9));
}
.executive-comment-card.share_note {
  border-color: rgba(59, 130, 246, 0.25);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.92), rgba(255, 255, 255, 0.9));
}
.executive-comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
[data-theme="dark"] .executive-comment-card {
  background: rgba(30, 41, 59, 0.86);
  border-color: rgba(148, 163, 184, 0.24);
}
@media (max-width: 900px) {
  .executive-workflow-grid {
    grid-template-columns: 1fr;
  }
}
@media print {
  .executive-snapshot-comments-card form,
  .executive-snapshot-workflow .button-row {
    display: none !important;
  }
}


/* v2.24 Executive Report related report links */
.executive-snapshot-related {
  margin-top: 1rem;
}
.executive-related-panel {
  display: grid;
  gap: 1rem;
}
.executive-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}
.executive-related-card {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}
[data-theme="dark"] .executive-related-card {
  background: rgba(30, 41, 59, 0.86);
  border-color: rgba(148, 163, 184, 0.24);
}
@media print {
  .executive-snapshot-related .button-link {
    display: none !important;
  }
}


/* v2.24 SaaS tenant foundation */
.tenant-context-chip {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tenant-current-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem;
  border-radius: 22px;
  border: 1px solid rgba(59, 130, 246, 0.22);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.9));
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}
.tenant-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.tenant-select-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.07);
}
.tenant-select-card.active {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.96), rgba(255, 255, 255, 0.9));
}
[data-theme="dark"] .tenant-current-card,
[data-theme="dark"] .tenant-select-card {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.24);
}
@media (max-width: 720px) {
  .tenant-current-card {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* v2.36 SaaS tenant isolation health */
.tenant-health-panel {
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(239,246,255,0.78));
}
.tenant-health-hero {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255,255,255,0.86);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}
.tenant-health-hero.ready {
  background: linear-gradient(135deg, rgba(240,253,244,0.95), rgba(255,255,255,0.92));
}
.tenant-health-hero.warning {
  background: linear-gradient(135deg, rgba(255,251,235,0.95), rgba(255,255,255,0.92));
}
.tenant-health-hero.blocker,
.tenant-health-hero.danger {
  background: linear-gradient(135deg, rgba(254,242,242,0.95), rgba(255,255,255,0.92));
}
.tenant-health-score {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.tenant-health-score span {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tenant-health-score strong {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  line-height: 1;
}
.tenant-health-meter {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15,23,42,0.08);
}
.tenant-health-meter-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3B82F6, #06B6D4);
}
.tenant-health-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
}
.tenant-health-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.tenant-health-check {
  padding: 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.22);
  background: rgba(248,250,252,0.88);
}
.tenant-health-check.ready {
  border-color: rgba(34,197,94,0.25);
}
.tenant-health-check.critical,
.tenant-health-check.danger {
  border-color: rgba(239,68,68,0.3);
  background: rgba(254,242,242,0.82);
}
.tenant-health-check.warning {
  border-color: rgba(245,158,11,0.32);
  background: rgba(255,251,235,0.82);
}
.tenant-health-table-wrap {
  margin-top: 1rem;
}
.command-list {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}
.command-list code {
  padding: 0.25rem 0.45rem;
  border-radius: 999px;
  background: rgba(15,23,42,0.06);
}
[data-theme="dark"] .tenant-health-panel,
[data-theme="dark"] .tenant-health-hero,
[data-theme="dark"] .tenant-health-check {
  background: rgba(30,41,59,0.84);
  border-color: rgba(148,163,184,0.24);
}


/* v2.37 tenant operations ledger */
.tenant-ops-ledger-panel {
  border: 1px solid rgba(59, 130, 246, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.72));
}
.tenant-risk-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.compact-actions {
  gap: 0.35rem;
  flex-wrap: wrap;
}
[data-theme="dark"] .tenant-ops-ledger-panel {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.82));
  border-color: rgba(148, 163, 184, 0.22);
}


/* v2.39 tenant support timeline / readonly support view */
.tenant-support-timeline-panel,
.tenant-readonly-support-panel {
  border: 1px solid rgba(59, 130, 246, 0.16);
  background: linear-gradient(135deg, rgba(255,255,255,0.94), rgba(239,246,255,0.72));
}
.tenant-support-timeline-empty {
  padding: 1rem;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.8);
  color: var(--muted);
}
.tenant-support-timeline-head,
.tenant-readonly-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tenant-readonly-banner {
  padding: 0.85rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(14, 165, 233, 0.25);
  background: rgba(240, 249, 255, 0.88);
}
[data-theme="dark"] .tenant-support-timeline-panel,
[data-theme="dark"] .tenant-readonly-support-panel {
  background: linear-gradient(135deg, rgba(30,41,59,0.92), rgba(15,23,42,0.88));
  border-color: rgba(148, 163, 184, 0.24);
}
[data-theme="dark"] .tenant-support-timeline-empty,
[data-theme="dark"] .tenant-readonly-banner {
  background: rgba(15, 23, 42, 0.72);
}


/* v2.40 tenant support detail search */
.tenant-support-detail-panel {
  border: 1px solid rgba(59, 130, 246, 0.16);
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(248,250,252,0.82));
}
.tenant-support-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(5, minmax(130px, 1fr)) auto auto;
  gap: 0.7rem;
  align-items: end;
  margin: 1rem 0;
}
.tenant-support-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
@media (max-width: 1100px) {
  .tenant-support-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .tenant-support-filter-bar {
    grid-template-columns: 1fr;
  }
}
[data-theme="dark"] .tenant-support-detail-panel {
  background: linear-gradient(135deg, rgba(30,41,59,0.92), rgba(15,23,42,0.86));
  border-color: rgba(148, 163, 184, 0.24);
}

/* v2.40 tenant support timeline */


/* v2.41 tenant support executive dashboard */
.tenant-support-executive-panel {
  border: 1px solid rgba(59, 130, 246, 0.16);
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(240,249,255,0.82));
}
.tenant-support-insight-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255,255,255,0.88);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  margin-bottom: 1rem;
}
.tenant-support-insight-hero.medium {
  border-color: rgba(245, 158, 11, 0.32);
  background: linear-gradient(135deg, rgba(255,251,235,0.96), rgba(255,255,255,0.9));
}
.tenant-support-executive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}
.tenant-support-breakdown-card,
.tenant-support-attention-panel,
.tenant-support-recommendations {
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255,255,255,0.9);
}
.tenant-support-bar-list {
  display: grid;
  gap: 0.65rem;
}
.tenant-support-bar-row {
  display: grid;
  gap: 0.25rem;
}
.tenant-support-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
}
.tenant-support-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}
.tenant-support-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3B82F6, #06B6D4);
}
.tenant-support-attention-panel,
.tenant-support-recommendations {
  margin-top: 1rem;
}
[data-theme="dark"] .tenant-support-executive-panel {
  background: linear-gradient(135deg, rgba(30,41,59,0.92), rgba(15,23,42,0.88));
}
[data-theme="dark"] .tenant-support-insight-hero,
[data-theme="dark"] .tenant-support-breakdown-card,
[data-theme="dark"] .tenant-support-attention-panel,
[data-theme="dark"] .tenant-support-recommendations {
  background: rgba(30,41,59,0.86);
  border-color: rgba(148, 163, 184, 0.24);
}
@media (max-width: 720px) {
  .tenant-support-insight-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* v2.41 tenant support timeline compatibility marker */


/* v2.42 limited multi-tenant pilot */
.tenant-pilot-panel {
  border: 1px solid rgba(34, 197, 94, 0.18);
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.92), rgba(255, 255, 255, 0.9));
}
.tenant-pilot-setup-form textarea {
  min-height: 110px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-theme="dark"] .tenant-pilot-panel {
  background: linear-gradient(135deg, rgba(20, 83, 45, 0.26), rgba(15, 23, 42, 0.9));
  border-color: rgba(74, 222, 128, 0.22);
}

/* v2.43 limited pilot user membership tools */
.tenant-pilot-users-panel {
  border: 1px solid rgba(6, 182, 212, 0.18);
  background: linear-gradient(135deg, rgba(236, 254, 255, 0.88), rgba(255, 255, 255, 0.92));
}
.tenant-pilot-users-panel textarea {
  min-height: 96px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-theme="dark"] .tenant-pilot-users-panel {
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.35), rgba(15, 23, 42, 0.9));
  border-color: rgba(6, 182, 212, 0.24);
}


/* v2.44 pilot smoke checklist and seed templates */
.tenant-pilot-smoke-panel {
  border: 1px solid rgba(14, 165, 233, 0.18);
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.94), rgba(255, 255, 255, 0.9));
}
.tenant-smoke-flow {
  margin: 0.75rem 0 1rem;
  position: sticky;
  top: 0.75rem;
  z-index: 25;
  padding-left: 1.3rem;
  color: var(--muted);
}
.tenant-smoke-flow li {
  margin: 0.25rem 0;
}
[data-theme="dark"] .tenant-pilot-smoke-panel {
  background: linear-gradient(135deg, rgba(12, 74, 110, 0.24), rgba(15, 23, 42, 0.9));
  border-color: rgba(56, 189, 248, 0.22);
}


/* v2.45 UAT UX fixes: postal autofill, estimate wizard action visibility, compact step 3 */
.postal-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .45rem;
  align-items: center;
}
.postal-code-row .small { white-space: nowrap; }
.estimate-wizard-form .wizard-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  padding: .75rem;
  margin-inline: -.25rem;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 16px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, .08);
  backdrop-filter: blur(10px);
}
.estimate-wizard-form[data-wizard-step="3"] .wizard-step[data-wizard-panel="3"] {
  padding: .85rem;
}
.estimate-wizard-form[data-wizard-step="3"] .document-lines {
  display: grid;
  gap: .65rem;
  overflow-x: auto;
}
.estimate-wizard-form[data-wizard-step="3"] .document-line-row {
  grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.8fr) minmax(74px, .55fr) minmax(72px, .55fr) minmax(120px, .85fr) minmax(84px, .6fr) minmax(110px, .8fr) 40px;
  gap: .45rem;
  padding: .55rem;
  border-radius: 14px;
}
.estimate-wizard-form[data-wizard-step="3"] .document-line-row label {
  font-size: .82rem;
}
.estimate-wizard-form[data-wizard-step="3"] .document-line-row input {
  min-height: 36px;
  padding: .42rem .5rem;
}
.estimate-wizard-form[data-wizard-step="3"] .document-line-toolbar {
  position: sticky;
  bottom: 72px;
  z-index: 10;
  padding: .55rem;
  border-radius: 14px;
  background: rgba(248, 250, 252, .96);
  border: 1px solid rgba(148, 163, 184, .22);
}
.form-status[data-deal-stage-update-status] {
  padding: .55rem .7rem;
  border-radius: 12px;
  background: rgba(248, 250, 252, .88);
  border: 1px solid rgba(148, 163, 184, .22);
}
[data-theme="dark"] .estimate-wizard-form .wizard-actions,
[data-theme="dark"] .estimate-wizard-form[data-wizard-step="3"] .document-line-toolbar,
[data-theme="dark"] .form-status[data-deal-stage-update-status] {
  background: rgba(15, 23, 42, .92);
}
@media (max-width: 900px) {
  .postal-code-row { grid-template-columns: 1fr; }
  .estimate-wizard-form[data-wizard-step="3"] .document-line-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .estimate-wizard-form[data-wizard-step="3"] .document-line-row .line-service-item,
  .estimate-wizard-form[data-wizard-step="3"] .document-line-row .line-description,
  .estimate-wizard-form[data-wizard-step="3"] .document-line-row .line-calculated {
    grid-column: 1 / -1;
  }
}


/* v2.46 pilot UAT progress */
.tenant-pilot-uat-panel {
  border: 1px solid rgba(245, 158, 11, 0.22);
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.92), rgba(255, 255, 255, 0.9));
}
.tenant-uat-status,
.tenant-uat-tester,
.tenant-uat-memo {
  width: 100%;
  min-width: 120px;
}
.tenant-uat-memo {
  min-height: 62px;
  resize: vertical;
}
[data-theme="dark"] .tenant-pilot-uat-panel {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.24), rgba(15, 23, 42, 0.9));
  border-color: rgba(245, 158, 11, 0.25);
}


/* v2.47 pilot UAT feedback ticket management */
.tenant-pilot-feedback-panel {
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.94), rgba(255, 255, 255, 0.9));
}
.tenant-feedback-suggestions {
  margin: 1rem 0;
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  background: rgba(255, 251, 235, 0.72);
}
[data-theme="dark"] .tenant-pilot-feedback-panel,
[data-theme="dark"] .tenant-feedback-suggestions {
  background: linear-gradient(135deg, rgba(69, 26, 3, 0.28), rgba(15, 23, 42, 0.9));
  border-color: rgba(245, 158, 11, 0.28);
}


/* v2.48 global visual polish: SaaS button/table/form refinement */
:root {
  --surface-elevated: rgba(255, 255, 255, 0.92);
  --surface-subtle: #f8fafc;
  --line-soft: rgba(148, 163, 184, 0.24);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.07);
  --shadow-hover: 0 18px 45px rgba(15, 23, 42, 0.11);
  --radius-lg: 18px;
  --radius-md: 14px;
  --button-height: 42px;
  --button-height-sm: 34px;
}
body {
  text-rendering: geometricPrecision;
}
.panel,
.card,
.kpi,
.action-card,
.mini-form,
.preflight-card,
.executive-chart-card,
.executive-insight-card {
  border-color: var(--line-soft, var(--line));
  box-shadow: var(--shadow-soft);
}
.panel,
.card {
  border-radius: var(--radius-lg);
}
.panel:hover,
.card:hover {
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
}
button,
.button-link,
a.button-link,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: var(--button-height);
  max-width: 100%;
  border-radius: 999px;
  padding: 0.68rem 1rem;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  text-wrap: nowrap;
  text-decoration: none;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
button:hover,
.button-link:hover,
a.button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.11);
}
button:active,
.button-link:active,
a.button-link:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
button.secondary,
.button-link.secondary,
a.button-link.secondary {
  background: #f8fafc;
  color: #1e293b;
  border-color: #cbd5e1;
}
button.secondary:hover,
.button-link.secondary:hover,
a.button-link.secondary:hover {
  background: #eef2ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
button.ghost,
.button-link.ghost,
a.button-link.ghost {
  background: transparent;
  color: #334155;
  border-color: transparent;
  box-shadow: none;
}
button.ghost:hover,
.button-link.ghost:hover,
a.button-link.ghost:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}
button.danger,
.button-link.danger {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}
button.danger:hover,
.button-link.danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}
button.small,
.button-link.small,
.compact-actions button,
.compact-actions .button-link,
.button-row.compact button,
.button-row.compact .button-link {
  min-height: var(--button-height-sm);
  padding: 0.48rem 0.72rem;
  font-size: 0.83rem;
  border-radius: 999px;
}
button[disabled],
button:disabled,
.button-link[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none !important;
  box-shadow: none !important;
}
.button-row,
.actions,
.compact-actions,
.heading-actions,
.page-context-actions,
.toolbar .button-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.compact-actions {
  gap: 0.4rem;
}
.table-wrap {
  border: 1px solid var(--line-soft, var(--line));
  border-radius: var(--radius-lg);
  overflow: auto;
  background: #fff;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.045);
}
.table-wrap table,
.panel table,
.card table {
  border-collapse: separate;
  border-spacing: 0;
}
th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
td {
  color: #1f2937;
}
th,
td {
  border-bottom-color: #e2e8f0;
  padding: 0.78rem 0.85rem;
}
tbody tr {
  transition: background-color 0.14s ease;
}
tbody tr:hover {
  background: #f8fafc;
}
td .button-row,
td .compact-actions,
td .actions {
  min-width: max-content;
}
td:has(.button-row),
td:has(.compact-actions),
td:has(.actions) {
  white-space: nowrap;
}
input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  border-color: #cbd5e1;
  background: #fff;
  color: #111827;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.035);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}
textarea {
  line-height: 1.55;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
  outline: none;
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: auto;
  box-shadow: none;
}
label {
  color: #334155;
  font-weight: 800;
}
.toolbar,
.page-context-bar,
.detail-heading,
.executive-ops-hero,
.tenant-pilot-panel,
.tenant-health-panel,
.tenant-ops-ledger-panel {
  border-color: var(--line-soft, var(--line));
  box-shadow: var(--shadow-soft);
}
.toolbar {
  align-items: end;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(248,250,252,0.94), rgba(255,255,255,0.9));
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-height: 1.55rem;
  line-height: 1;
  white-space: nowrap;
}
.kpi .value,
.executive-kpi-value,
.metric-value {
  letter-spacing: -0.03em;
}
.stacked-form,
.form-grid,
.inline-form {
  gap: 0.9rem;
}
.section-heading.compact,
.section-head,
.page-heading {
  align-items: flex-start;
}
.page-heading .button-row,
.section-heading .button-row,
.section-head .button-row {
  justify-content: flex-end;
}
.wizard-actions {
  position: sticky;
  bottom: 0.75rem;
  z-index: 12;
  padding: 0.75rem;
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.13);
  backdrop-filter: blur(12px);
}
.wizard-actions button {
  min-width: 112px;
}
.document-line-row,
.estimate-wizard-lines .document-line-row {
  align-items: end;
}
@media (max-width: 820px) {
  .page-heading .button-row,
  .section-heading .button-row,
  .section-head .button-row {
    justify-content: flex-start;
  }
  .button-row,
  .actions,
  .compact-actions,
  .heading-actions {
    gap: 0.45rem;
  }
  button,
  .button-link,
  a.button-link {
    min-height: 40px;
    padding-inline: 0.82rem;
  }
  .table-wrap {
    border-radius: 14px;
  }
}
@media (max-width: 560px) {
  .button-row:not(.compact-actions),
  .actions:not(.compact-actions) {
    align-items: stretch;
  }
  .button-row:not(.compact-actions) > button,
  .button-row:not(.compact-actions) > .button-link,
  .actions:not(.compact-actions) > button,
  .actions:not(.compact-actions) > .button-link {
    flex: 1 1 auto;
  }
  .compact-actions {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.15rem;
  }
  .compact-actions button,
  .compact-actions .button-link {
    flex: 0 0 auto;
  }
}
[data-theme="dark"] .panel,
[data-theme="dark"] .card,
[data-theme="dark"] .kpi,
[data-theme="dark"] .action-card,
[data-theme="dark"] .mini-form,
[data-theme="dark"] .preflight-card,
[data-theme="dark"] .table-wrap {
  background: rgba(30, 41, 59, 0.84);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(148, 163, 184, 0.36);
  color: #f8fafc;
}
[data-theme="dark"] th {
  background: rgba(15, 23, 42, 0.86);
  color: #cbd5e1;
}
[data-theme="dark"] td {
  color: #e5e7eb;
}
[data-theme="dark"] tbody tr:hover {
  background: rgba(51, 65, 85, 0.56);
}
[data-theme="dark"] button.secondary,
[data-theme="dark"] .button-link.secondary {
  background: rgba(30, 41, 59, 0.94);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.34);
}
[data-theme="dark"] button.secondary:hover,
[data-theme="dark"] .button-link.secondary:hover {
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.48);
}
[data-theme="dark"] .wizard-actions {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.28);
}


/* v2.49 screen-level visual polish / major page card layout */
:root {
  --surface-glass: rgba(255, 255, 255, 0.86);
  --surface-soft: #f8fafc;
  --surface-tint: #eff6ff;
  --shadow-lift: 0 18px 46px rgba(15, 23, 42, 0.11);
  --shadow-subtle: 0 10px 28px rgba(15, 23, 42, 0.07);
  --radius-xl: 24px;
}
.container {
  max-width: min(1440px, calc(100vw - 32px));
}
.polished-page,
.screen-polish-page {
  display: grid;
  gap: 1.15rem;
}
.polished-hero,
.page-heading.polished-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 28px;
  padding: clamp(1.25rem, 2.4vw, 2rem);
  background:
    radial-gradient(circle at 12% 0%, rgba(59, 130, 246, 0.16), transparent 34%),
    radial-gradient(circle at 86% 20%, rgba(6, 182, 212, 0.13), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
  box-shadow: var(--shadow-subtle);
}
.polished-hero::after,
.page-heading.polished-hero::after {
  content: "";
  position: absolute;
  inset: auto -6rem -8rem auto;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.08);
  pointer-events: none;
}
.polished-hero h1,
.page-heading.polished-hero h1 {
  letter-spacing: -0.04em;
  font-size: clamp(1.65rem, 2.7vw, 2.4rem);
  line-height: 1.08;
  margin-bottom: 0.35rem;
}
.polished-hero .muted,
.page-heading.polished-hero .muted {
  max-width: 68ch;
  line-height: 1.65;
}
.polished-hero .heading-actions,
.polished-hero .button-row,
.page-heading.polished-hero .heading-actions,
.page-heading.polished-hero .button-row {
  position: relative;
  z-index: 1;
}
.surface-grid,
.page-two-column,
.polished-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.58fr);
  gap: 1rem;
  align-items: start;
}
.surface-grid.reverse {
  grid-template-columns: minmax(320px, 0.58fr) minmax(0, 1.05fr);
}
.polished-stack {
  display: grid;
  gap: 1rem;
}
.panel.polished-panel,
.card.polished-card,
.polished-card {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-subtle);
}
.panel.polished-panel:hover,
.polished-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}
.panel.compact-panel {
  padding: clamp(1rem, 1.8vw, 1.35rem);
}
.section-heading-row,
.section-heading.compact,
.section-head {
  gap: 0.85rem;
}
.section-heading-row h2,
.section-heading.compact h2,
.section-head h2,
.panel > h2:first-child {
  letter-spacing: -0.025em;
}
.form-grid.compact-grid,
.client-form .compact-grid,
.form-grid.dense-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.form-section,
fieldset.form-section {
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.92));
  padding: 1rem;
}
.form-section legend {
  padding: 0 0.35rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #0f172a;
}
.document-form-shell .document-lines,
.document-lines.polished-lines {
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.88), rgba(255, 255, 255, 0.94));
  padding: 0.85rem;
  overflow-x: auto;
}
.document-form-shell .document-line-row,
.document-lines.polished-lines .document-line-row {
  min-width: 1080px;
  grid-template-columns: minmax(150px, 0.85fr) minmax(280px, 1.4fr) minmax(76px, 0.48fr) minmax(70px, 0.44fr) minmax(116px, 0.72fr) minmax(86px, 0.52fr) minmax(112px, 0.58fr) 42px;
  gap: 0.65rem;
  padding: 0.65rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(226, 232, 240, 0.9);
}
.document-line-toolbar {
  position: sticky;
  left: 0;
  padding-top: 0.75rem;
}
.list-shell,
.table-shell {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
}
.list-shell > .section-heading-row,
.table-shell > .section-heading-row,
.list-shell > h2:first-child,
.table-shell > h2:first-child {
  padding: 1rem 1rem 0;
}
.list-shell > [id$="list"],
.table-shell > [id$="list"],
.list-shell > div:last-child,
.table-shell > div:last-child {
  padding: 0.85rem 1rem 1rem;
}
.status-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
}
.status-tile {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.86);
  padding: 0.85rem;
}
.status-tile strong {
  display: block;
  font-size: 1.15rem;
  letter-spacing: -0.035em;
}
.status-tile span {
  color: var(--muted);
  font-size: 0.85rem;
}
.admin-console-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1rem;
  align-items: start;
}
.admin-console-grid > .panel,
.tenant-admin-layout > .panel {
  min-width: 0;
}
.client-registration-panel,
.document-create-panel,
.deal-create-panel {
  scroll-margin-top: 5rem;
}
.form-actions,
.inline-actions,
.document-line-toolbar,
.heading-actions {
  flex-wrap: wrap;
}
.form-actions button,
.inline-actions button,
.document-line-toolbar button,
.heading-actions .button-link,
.heading-actions button {
  max-width: 100%;
}
@media (max-width: 1080px) {
  .surface-grid,
  .surface-grid.reverse,
  .page-two-column,
  .polished-two-column {
    grid-template-columns: 1fr;
  }
  .admin-console-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .container {
    max-width: min(100vw - 18px, 1440px);
  }
  .polished-hero,
  .page-heading.polished-hero {
    border-radius: 20px;
  }
  .document-form-shell .document-lines,
  .document-lines.polished-lines {
    margin-inline: -0.35rem;
  }
}
[data-theme="dark"] .polished-hero,
[data-theme="dark"] .page-heading.polished-hero {
  background:
    radial-gradient(circle at 12% 0%, rgba(59, 130, 246, 0.25), transparent 34%),
    radial-gradient(circle at 86% 20%, rgba(6, 182, 212, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.92));
  border-color: rgba(148, 163, 184, 0.22);
}
[data-theme="dark"] .panel.polished-panel,
[data-theme="dark"] .card.polished-card,
[data-theme="dark"] .polished-card,
[data-theme="dark"] .list-shell,
[data-theme="dark"] .table-shell {
  background: rgba(30, 41, 59, 0.82);
  border-color: rgba(148, 163, 184, 0.22);
}
[data-theme="dark"] .form-section,
[data-theme="dark"] fieldset.form-section,
[data-theme="dark"] .document-form-shell .document-lines,
[data-theme="dark"] .document-lines.polished-lines,
[data-theme="dark"] .status-tile {
  background: rgba(15, 23, 42, 0.58);
  border-color: rgba(148, 163, 184, 0.22);
}
[data-theme="dark"] .form-section legend {
  color: #f8fafc;
}
[data-theme="dark"] .document-form-shell .document-line-row,
[data-theme="dark"] .document-lines.polished-lines .document-line-row {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(148, 163, 184, 0.22);
}

/* v2.50 mobile list cards and action ergonomics */
.responsive-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.responsive-card-table td.mobile-card-actions,
.responsive-card-table td.actions {
  min-width: 150px;
}
.compact-actions,
.button-row.compact-actions,
.actions.compact-actions {
  gap: 0.45rem;
}
.compact-actions > button,
.compact-actions > .button-link,
td.actions button,
td.actions .button-link,
td.mobile-card-actions button,
td.mobile-card-actions .button-link {
  min-height: 34px;
  max-width: 100%;
}
.mobile-card-actions .button-row,
.mobile-card-actions .compact-actions,
td.actions .button-row,
td.actions .compact-actions {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-block: 0.08rem;
  scrollbar-width: thin;
}
@media (max-width: 720px) {
  .table-wrap.responsive-table-wrap,
  .list-shell .table-wrap,
  .table-shell .table-wrap {
    overflow: visible;
    border: 0;
    box-shadow: none;
    background: transparent;
  }
  table.responsive-card-table,
  table.responsive-card-table thead,
  table.responsive-card-table tbody,
  table.responsive-card-table tr,
  table.responsive-card-table th,
  table.responsive-card-table td {
    display: block;
    width: 100%;
  }
  table.responsive-card-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  table.responsive-card-table tbody {
    display: grid;
    gap: 0.85rem;
  }
  table.responsive-card-table tr {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 20px;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
  }
  table.responsive-card-table tr:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.1);
  }
  table.responsive-card-table td {
    display: grid;
    grid-template-columns: minmax(7.5rem, 36%) minmax(0, 1fr);
    gap: 0.7rem;
    align-items: start;
    padding: 0.45rem 0;
    border: 0;
    min-width: 0;
    white-space: normal;
  }
  table.responsive-card-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.4;
  }
  table.responsive-card-table td:empty,
  table.responsive-card-table td[data-label=""]::before {
    display: none;
  }
  table.responsive-card-table td.mobile-card-actions,
  table.responsive-card-table td.actions {
    display: block;
    padding-top: 0.75rem;
    margin-top: 0.45rem;
    border-top: 1px solid rgba(226, 232, 240, 0.95);
  }
  table.responsive-card-table td.mobile-card-actions::before,
  table.responsive-card-table td.actions::before {
    display: block;
    margin-bottom: 0.45rem;
    content: attr(data-label);
  }
  table.responsive-card-table td.mobile-card-actions .button-row,
  table.responsive-card-table td.mobile-card-actions .compact-actions,
  table.responsive-card-table td.actions .button-row,
  table.responsive-card-table td.actions .compact-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.18rem;
    scroll-snap-type: x proximity;
  }
  table.responsive-card-table td.mobile-card-actions button,
  table.responsive-card-table td.mobile-card-actions .button-link,
  table.responsive-card-table td.actions button,
  table.responsive-card-table td.actions .button-link {
    flex: 0 0 auto;
    min-width: max-content;
    scroll-snap-align: start;
  }
  .toolbar.compact-actions,
  .button-row.compact-actions,
  .actions.compact-actions {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    scrollbar-width: thin;
  }
  .polished-hero .heading-actions,
  .page-heading .button-row,
  .section-heading .button-row {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.15rem;
  }
  .polished-hero .heading-actions > *,
  .page-heading .button-row > *,
  .section-heading .button-row > * {
    flex: 0 0 auto;
  }
}
@media (max-width: 520px) {
  table.responsive-card-table td {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
  table.responsive-card-table td::before {
    font-size: 0.72rem;
  }
  table.responsive-card-table tr {
    padding: 0.8rem;
    border-radius: 18px;
  }
  .mobile-bottom-nav {
    box-shadow: 0 -18px 40px rgba(15, 23, 42, 0.16);
  }
}
[data-theme="dark"] table.responsive-card-table tr {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
}
[data-theme="dark"] table.responsive-card-table td.mobile-card-actions,
[data-theme="dark"] table.responsive-card-table td.actions {
  border-top-color: rgba(148, 163, 184, 0.24);
}

/* v2.51 mobile action menu and mobile card refinements */
.mobile-action-menu {
  display: none;
}
.mobile-action-original {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}
.mobile-action-original > .button-row,
.mobile-action-original > .compact-actions {
  flex-wrap: nowrap;
}
@media (max-width: 720px) {
  table.responsive-card-table tr[data-card-title]::before {
    content: attr(data-card-title);
    display: block;
    margin-bottom: 0.6rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    color: var(--text);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.45;
  }
  table.responsive-card-table td.mobile-card-actions[data-mobile-menu-enhanced="true"],
  table.responsive-card-table td.actions[data-mobile-menu-enhanced="true"] {
    overflow: visible;
  }
  table.responsive-card-table td.mobile-card-actions[data-mobile-menu-enhanced="true"] .mobile-action-original,
  table.responsive-card-table td.actions[data-mobile-menu-enhanced="true"] .mobile-action-original {
    display: none;
  }
  table.responsive-card-table td.mobile-card-actions[data-mobile-menu-enhanced="true"] .mobile-action-menu,
  table.responsive-card-table td.actions[data-mobile-menu-enhanced="true"] .mobile-action-menu {
    display: block;
  }
  .mobile-action-menu summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 40px;
    min-width: 7rem;
    padding: 0.58rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.28);
    background: linear-gradient(135deg, #eff6ff, #ffffff);
    color: #1e3a8a;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.1);
  }
  .mobile-action-menu summary::-webkit-details-marker {
    display: none;
  }
  .mobile-action-menu summary::after {
    content: '▾';
    font-size: 0.78rem;
    opacity: 0.72;
  }
  .mobile-action-menu[open] summary::after {
    content: '▴';
  }
  .mobile-action-menu-body {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.6rem;
    padding: 0.6rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(248, 250, 252, 0.96);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
  }
  .mobile-action-menu-body .mobile-action-menu-item,
  .mobile-action-menu-body button.mobile-action-menu-item,
  .mobile-action-menu-body a.mobile-action-menu-item {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    min-height: 42px;
    white-space: normal;
    text-wrap: pretty;
  }
  .polished-hero .heading-actions,
  .page-heading .button-row,
  .section-heading .button-row {
    border-radius: 999px;
  }
}
[data-theme="dark"] table.responsive-card-table tr[data-card-title]::before {
  border-color: rgba(148, 163, 184, 0.25);
  color: #f8fafc;
}
[data-theme="dark"] .mobile-action-menu summary {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.45), rgba(30, 41, 59, 0.94));
  border-color: rgba(96, 165, 250, 0.34);
  color: #dbeafe;
}
[data-theme="dark"] .mobile-action-menu-body {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.24);
}


/* v2.52 dedicated mobile cards and prioritized actions */
.mobile-primary-actions {
  display: none;
}
@media (max-width: 720px) {
  table.responsive-card-table tr[data-mobile-card-type] {
    position: relative;
    overflow: hidden;
  }
  table.responsive-card-table tr[data-mobile-card-type]::before {
    padding-left: 0.72rem;
    border-left: 4px solid rgba(59, 130, 246, 0.66);
  }
  table.responsive-card-table tr[data-mobile-card-type="client"]::before {
    border-left-color: rgba(6, 182, 212, 0.74);
  }
  table.responsive-card-table tr[data-mobile-card-type="deal"]::before {
    border-left-color: rgba(59, 130, 246, 0.78);
  }
  table.responsive-card-table tr[data-mobile-card-type="estimate"]::before {
    border-left-color: rgba(139, 92, 246, 0.72);
  }
  table.responsive-card-table tr[data-mobile-card-type="invoice"]::before {
    border-left-color: rgba(34, 197, 94, 0.72);
  }
  table.responsive-card-table tr[data-mobile-card-type="tenant"]::before {
    border-left-color: rgba(245, 158, 11, 0.78);
  }
  table.responsive-card-table tr[data-card-subtitle]::after,
  table.responsive-card-table tr[data-card-meta]::after,
  table.responsive-card-table tr[data-card-metrics]::after {
    content: attr(data-card-subtitle) "\A" attr(data-card-meta) "\A" attr(data-card-metrics);
    display: block;
    white-space: pre-line;
    margin: -0.25rem 0 0.72rem;
    padding: 0.55rem 0.72rem;
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.9);
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.55;
  }
  table.responsive-card-table td.mobile-card-actions[data-mobile-menu-enhanced="true"],
  table.responsive-card-table td.actions[data-mobile-menu-enhanced="true"] {
    display: grid;
    gap: 0.55rem;
  }
  .mobile-primary-actions {
    display: flex;
    gap: 0.45rem;
    align-items: stretch;
    flex-wrap: wrap;
  }
  .mobile-primary-actions .mobile-action-menu-item {
    flex: 1 1 8rem;
    min-height: 42px;
    justify-content: center;
    white-space: nowrap;
    text-wrap: nowrap;
  }
  .mobile-primary-actions + .mobile-action-original + .mobile-action-menu,
  .mobile-action-original + .mobile-action-menu {
    margin-top: 0.1rem;
  }
  table.responsive-card-table tr[data-mobile-card-type="deal"] td:first-of-type[data-label=""] {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 0;
  }
  table.responsive-card-table tr[data-mobile-card-type="deal"] td:first-of-type[data-label=""] input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
  }
}
[data-theme="dark"] table.responsive-card-table tr[data-card-subtitle]::after,
[data-theme="dark"] table.responsive-card-table tr[data-card-meta]::after,
[data-theme="dark"] table.responsive-card-table tr[data-card-metrics]::after {
  background: rgba(15, 23, 42, 0.62);
}
[data-theme="dark"] .mobile-primary-actions .mobile-action-menu-item {
  border-color: rgba(148, 163, 184, 0.28);
}

/* v2.53 deal detail mobile tabs and admin panel controls */
.deal-mobile-tabs {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.45rem;
  margin: 0.75rem 0 1rem;
  position: sticky;
  top: 0.75rem;
  z-index: 25;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}
.deal-mobile-tab {
  min-height: 38px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: 0.86rem;
}
.deal-mobile-tab.is-active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
.deal-mobile-section {
  scroll-margin-top: 96px;
}
.tenant-admin-control-panel input#tenant-admin-panel-search {
  max-width: 520px;
}
.tenant-admin-collapsible {
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.tenant-admin-collapsible[hidden] {
  display: none !important;
}
.tenant-panel-quick-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.tenant-panel-toggle {
  flex: 0 0 auto;
}
.tenant-admin-collapsible.is-collapsed > :not(.section-heading):not(.tenant-panel-quick-header) {
  display: none !important;
}
.tenant-admin-collapsible.is-collapsed {
  padding-bottom: 0.85rem;
}
@media (max-width: 760px) {
  .deal-mobile-tabs {
    top: 0.4rem;
    z-index: 30;
  }
  .deal-detail-hero .heading-actions,
  .detail-heading .heading-actions {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.2rem;
  }
  .deal-mobile-section {
    border-radius: 20px;
  }
  .deal-basic-panel.detail-grid,
  .deal-stage-panel .detail-grid,
  .deal-work-panel .detail-grid {
    grid-template-columns: 1fr;
  }
  .tenant-admin-control-panel .button-row {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
}
[data-theme="dark"] .deal-mobile-tabs {
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(148, 163, 184, 0.24);
}
[data-theme="dark"] .deal-mobile-tab.is-active {
  background: #38bdf8;
  color: #082f49;
  border-color: #38bdf8;
}


/* v2.54 deal detail mobile action bar and tenant admin grouping */
.deal-mobile-snapshot,
.deal-detail-mobile-action-bar {
  display: none;
}

.tenant-admin-group-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.9rem 0 0.75rem;
}

.tenant-admin-group-filter .active,
.tenant-admin-group-filter button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.tenant-panel-group-badge {
  margin-top: 0.4rem;
}

.tenant-admin-collapsible {
  position: relative;
}

.tenant-admin-collapsible[hidden] {
  display: none !important;
}

.tenant-panel-group-pilot {
  border-left: 4px solid rgba(59, 130, 246, 0.55);
}

.tenant-panel-group-health {
  border-left: 4px solid rgba(245, 158, 11, 0.55);
}

.tenant-panel-group-support {
  border-left: 4px solid rgba(34, 197, 94, 0.55);
}

.tenant-panel-group-setup {
  border-left: 4px solid rgba(139, 92, 246, 0.52);
}

.tenant-panel-group-general {
  border-left: 4px solid rgba(148, 163, 184, 0.45);
}

@media (max-width: 720px) {
  #deal-detail-root {
    padding-bottom: 5.8rem;
  }

  .deal-mobile-snapshot {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 0.75rem 0 1rem;
  position: sticky;
  top: 0.75rem;
  z-index: 25;
  }

  .deal-mobile-snapshot-card {
    display: grid;
    gap: 0.25rem;
    justify-items: start;
    min-height: 96px;
    padding: 0.85rem;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(248,250,252,0.86));
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    color: var(--text);
    white-space: normal;
    text-align: left;
  }

  .deal-mobile-snapshot-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 800;
  }

  .deal-mobile-snapshot-card strong {
    font-size: 1rem;
    line-height: 1.25;
  }

  .deal-mobile-snapshot-note {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .deal-detail-mobile-action-bar {
    position: fixed;
    z-index: 60;
    left: max(0.7rem, env(safe-area-inset-left));
    right: max(0.7rem, env(safe-area-inset-right));
    bottom: max(0.7rem, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    padding: 0.55rem;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255,255,255,0.92);
    box-shadow: 0 22px 70px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(18px);
  }

  .deal-detail-mobile-action-bar button,
  .deal-detail-mobile-action-bar .button-link {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding-inline: 0.45rem;
    font-size: 0.78rem;
  }

  .deal-mobile-section,
  .deal-summary-panel,
  .deal-documents-panel,
  .deal-basic-panel,
  .deal-records-panel,
  .deal-timeline-panel {
    scroll-margin-top: 7.5rem;
  }

  .tenant-admin-group-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .tenant-admin-group-filter button {
    flex: 0 0 auto;
  }
}

[data-theme="dark"] .deal-mobile-snapshot-card {
  background: linear-gradient(135deg, rgba(30,41,59,0.94), rgba(15,23,42,0.86));
  border-color: rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] .deal-detail-mobile-action-bar {
  background: rgba(15,23,42,0.92);
  border-color: rgba(148, 163, 184, 0.26);
}



/* v2.55 mobile UAT checklist */
.tenant-mobile-uat-panel {
  border: 1px solid rgba(14, 165, 233, 0.18);
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.92), rgba(255, 255, 255, 0.9));
}
.tenant-mobile-uat-panel .tenant-uat-memo {
  min-width: 180px;
}
.tenant-mobile-uat-panel table.responsive-card-table tr[data-card-title]::before {
  content: "📱 " attr(data-card-title);
}
[data-theme="dark"] .tenant-mobile-uat-panel {
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.34), rgba(15, 23, 42, 0.9));
  border-color: rgba(125, 211, 252, 0.22);
}

/* v2.64 mobile tenant switcher */
.mobile-tenant-switcher {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: rgba(255, 255, 255, 0.82);
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 700;
}
@media (max-width: 720px) {
  .mobile-tenant-switcher {
    display: inline-flex;
    max-width: 48vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tenant-context-chip {
    display: none;
  }
}
[data-theme="dark"] .mobile-tenant-switcher {
  background: rgba(15, 23, 42, 0.86);
  border-color: rgba(148, 163, 184, 0.28);
}

/* v2.65.1 KAI UI layout hardening: estimate wizard / responsive safety */
@media (max-width: 760px) {
  :root { --topbar-height: 56px; }
}

.global-nav details[open],
.mobile-tenant-switcher {
  position: relative;
  z-index: var(--z-dropdown);
}

@media (min-width: 981px) and (max-width: 1199px) {
  .document-line-row {
    grid-template-columns: minmax(160px, 1.4fr) minmax(70px, 0.5fr) minmax(60px, 0.4fr) minmax(110px, 0.7fr) minmax(80px, 0.5fr) auto auto;
    gap: 0.4rem;
  }
}

@media (min-width: 980px) and (max-width: 1199px) {
  .wizard-method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container wizard-step (max-width: 920px) {
  .wizard-method-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container wizard-step (max-width: 520px) {
  .wizard-method-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .knowledge-signal-row { justify-content: flex-start; }
}

.wizard-step .success-box {
  margin: 0;
  padding: 0.75rem;
}

.mobile-sticky-actions {
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

@media (max-width: 640px) {
  .document-line-row .icon-button,
  .icon-button { width: 100%; }
}

@media (max-width: 480px) {
  .modal-card { padding: 14px; }
}

/* v2.67 deal create UAT fixes: selectable client/owner, ABC probability, tax label, one-line deal title */
.form-hint {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 500;
}
.deal-entry-form .deal-title-field,
.form-grid > .deal-title-field {
  grid-column: 1 / -1;
  min-width: 0;
}
.deal-title-input,
.deal-title-cell,
.deal-title-link,
.deal-detail-hero h1 {
  min-width: 0;
}
.deal-title-input {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deal-title-cell {
  max-width: clamp(180px, 26vw, 420px);
}
.deal-title-link {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deal-detail-hero h1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(100%, 72rem);
}
@media (max-width: 760px) {
  .deal-title-cell {
    max-width: 100%;
  }
}
@media (max-width: 720px) {
  table.responsive-card-table tr[data-mobile-card-type="deal"][data-card-title]::before {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* v2.69 efficiency helpers: focus-only date shortcuts and compact document actions. */
.date-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.date-quick-chips[hidden] {
  display: none !important;
}
.document-line-toolbar [data-add-discount-line] {
  white-space: nowrap;
}

/* v2.70 client registration efficiency helpers */
.muted-input {
  background: var(--surface-muted, #f8fafc);
  color: var(--muted-color, #64748b);
}

/* v2.72.1 v2.71 client bug/layout fixes */
.field-error[data-client-assist-field-error="true"] ul {
  margin: 0;
  padding-left: 1.1rem;
}
.field-error[data-client-assist-field-error="true"][hidden] {
  display: none;
}
.form-grid .client-assist-panel {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border-color, var(--border, #d9e2ec));
  border-radius: 8px;
  background: var(--surface, #fff);
  overflow-wrap: anywhere;
}
.client-assist-panel .kpi-grid.small,
.client-assist-panel .kpi-grid.compact,
.client-assist-panel .small.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 16px;
}
.checkbox-grid label {
  white-space: nowrap;
}
.postal-code-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.postal-code-row input[name="postal_code"] {
  min-width: 140px;
  flex: 1 1 auto;
}
.postal-code-row button {
  flex: 0 0 auto;
  white-space: nowrap;
}
[data-postal-autofill-status] {
  display: block;
  flex-basis: 100%;
}
@media (max-width: 640px) {
  .client-assist-panel .kpi-grid.small,
  .client-assist-panel .kpi-grid.compact,
  .client-assist-panel .small.kpi-grid {
    grid-template-columns: 1fr;
  }
}


/* v2.72.2: document line editors include service-item select + description + qty/unit/price/tax/calculated/remove. */
.document-line-row,
.document-form-shell .document-line-row,
.document-lines.polished-lines .document-line-row,
.estimate-wizard-form[data-wizard-step="3"] .document-line-row {
  grid-template-columns: minmax(150px, 0.9fr) minmax(240px, 1.45fr) minmax(80px, .55fr) minmax(72px, .45fr) minmax(120px, .75fr) minmax(90px, .55fr) minmax(110px, .6fr) 42px;
}
.document-form-shell .document-line-row,
.document-lines.polished-lines .document-line-row {
  min-width: 1080px;
}
.estimate-wizard-form[data-wizard-step="3"] .document-line-row {
  min-width: 980px;
}
.document-line-row .line-service-item,
.document-line-row .line-description,
.document-line-row .line-calculated,
.document-line-row .line-master-save {
  min-width: 0;
}
.document-line-row .line-service-item select {
  width: 100%;
}
.document-line-row .line-master-save {
  grid-column: 1 / -1;
}
@media (max-width: 1100px) {
  .document-line-row:not(.compact-inline-line),
  .document-form-shell .document-line-row:not(.compact-inline-line),
  .document-lines.polished-lines .document-line-row:not(.compact-inline-line),
  .estimate-wizard-form[data-wizard-step="3"] .document-line-row:not(.compact-inline-line) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }
}

/* v2.72.3 payables/accounting compact filter row wrapping guard */
.form-row.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.form-row.compact > * {
  min-width: 0;
}

.form-row.compact > select,
.form-row.compact > input[type="search"] {
  min-width: min(240px, 100%);
  flex: 1 1 240px;
}

.form-row.compact > button,
.form-row.compact > .button-link {
  white-space: nowrap;
  flex: 0 0 auto;
}

/* v2.72.4: revenue form layout compatibility. */
.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 1rem;
  align-items: end;
}
.grid-form > .full-width {
  grid-column: 1 / -1;
  min-width: 0;
}
.grid-form input,
.grid-form select,
.grid-form textarea {
  min-width: 0;
}
@media (max-width: 640px) {
  .grid-form {
    grid-template-columns: 1fr;
  }
}

/* v2.72.7: client registration/edit layout hardening */
.client-page-layout > .client-registration-panel,
.client-page-layout > .list-shell,
.client-form,
.client-form .form-section,
.client-form fieldset.form-section,
.client-form .compact-grid,
.client-form label,
.client-form .client-assist-panel {
  min-width: 0;
}
.client-form .form-section,
.client-form fieldset.form-section {
  max-width: 100%;
}
.client-form label > input:not([type="checkbox"]):not([type="hidden"]),
.client-form label > select,
.client-form label > textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.client-form .postal-code-row input[name="postal_code"] {
  width: auto;
}
.client-form .form-actions button,
.client-form .inline-actions button {
  white-space: normal;
  text-wrap: balance;
}
.client-form .field-error,
.client-form .subtext {
  min-width: 0;
  overflow-wrap: anywhere;
}
.client-page-layout .list-shell > .section-heading-row > input[type="search"] {
  flex: 1 1 260px;
  min-width: min(100%, 220px);
  max-width: 100%;
}
@media (max-width: 640px) {
  .client-form .form-actions button,
  .client-form .form-actions .button-link,
  .client-form .inline-actions button,
  .client-form .inline-actions .button-link {
    flex: 1 1 100%;
  }
}

/* v2.72.8 deal registration/detail layout hardening */
.deal-create-panel,
.deal-entry-form,
.deal-entry-form > *,
.deal-entry-form label,
.deal-entry-form .form-hint,
.deal-list-toolbar,
.deal-bulk-toolbar,
#deals-list,
#pipeline-summary,
#deal-detail-root,
#deal-detail-root .panel,
#deal-detail-root .card,
#deal-detail-root .detail-grid,
#deal-detail-root .detail-grid > *,
#deal-detail-root .form-grid,
#deal-detail-root .form-grid > *,
#deal-detail-root .compact-form,
#deal-detail-root .kpi-grid,
#deal-detail-root .table-wrap,
#deal-detail-root .responsive-table-wrap,
#deal-detail-root .document-flow-grid,
#deal-detail-root .deal-document-form,
#deal-detail-root .deal-mobile-section,
#deal-detail-root .deal-files-panel,
#deal-detail-root .two-column-grid {
  min-width: 0;
}

.deal-entry-form input,
.deal-entry-form select,
.deal-entry-form textarea,
#deal-detail-root input,
#deal-detail-root select,
#deal-detail-root textarea {
  max-width: 100%;
}

.deal-list-toolbar label,
.deal-bulk-toolbar label {
  flex: 1 1 180px;
  min-width: min(180px, 100%);
}

.deal-list-toolbar input,
.deal-list-toolbar select,
.deal-bulk-toolbar input,
.deal-bulk-toolbar select {
  min-width: 0;
}

.deal-list-toolbar button,
.deal-bulk-toolbar button,
.deal-entry-form button,
#deal-detail-root .form-actions button,
#deal-detail-root .form-actions .button-link,
#deal-detail-root .heading-actions button,
#deal-detail-root .heading-actions .button-link {
  max-width: 100%;
  white-space: normal;
  text-wrap: balance;
}

#deal-detail-root .detail-heading,
#deal-detail-root .detail-heading > *,
#deal-detail-root .section-head,
#deal-detail-root .section-head > *,
#deal-detail-root .deal-next-action-copy,
#deal-detail-root .deal-next-action-links {
  min-width: 0;
}

#deal-detail-root .deal-next-action-bar {
  grid-template-columns: minmax(0, 1fr) minmax(min(420px, 100%), 0.9fr);
}

#deal-detail-root .deal-next-action-link {
  min-width: 0;
  white-space: normal;
  text-wrap: balance;
}

#deal-detail-root .deal-detail-hero .heading-actions {
  min-width: 0;
}

#deal-detail-root .deal-detail-hero .heading-actions > * {
  min-width: 0;
}

#deal-detail-root .two-column-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 1rem;
  align-items: start;
}

#deal-detail-root .two-column-grid > * {
  min-width: 0;
}

#deal-detail-root .deal-records-panel .tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 0.2rem;
  -webkit-overflow-scrolling: touch;
}

#deal-detail-root .deal-records-panel .tab-button {
  flex: 0 0 auto;
}

#deal-detail-root .deal-detail-table-wrap {
  max-width: 100%;
}

#deal-detail-root .deal-files-panel h3 {
  margin-top: 1rem;
}

#deal-detail-root .deal-files-panel .table-wrap {
  margin-top: 0.45rem;
}

#deal-detail-root .structured-memo-fields,
#deal-detail-root .quick-next-action .detail-grid {
  min-width: 0;
}

@media (max-width: 920px) {
  #deal-detail-root .deal-next-action-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .deal-list-toolbar,
  .deal-bulk-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .deal-list-toolbar label,
  .deal-bulk-toolbar label,
  .deal-list-toolbar button,
  .deal-bulk-toolbar button {
    width: 100%;
  }
  #deal-detail-root .detail-heading .heading-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    overflow: visible;
    padding-bottom: 0;
  }
  #deal-detail-root .detail-heading .heading-actions > * {
    width: 100%;
  }
  #deal-detail-root .deal-next-action-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  #deal-detail-root .deal-mobile-snapshot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  #deal-detail-root .detail-heading .heading-actions,
  #deal-detail-root .deal-next-action-links,
  #deal-detail-root .deal-mobile-snapshot {
    grid-template-columns: 1fr;
  }
}


/* v2.72.9: estimate wizard / estimate list / document edit layout hardening */
.recent-estimate-clone-button {
  grid-column: 1 / -1;
  justify-self: start;
  max-width: 100%;
  white-space: normal;
  text-align: left;
  overflow-wrap: anywhere;
}

.estimate-wizard-form .form-grid,
.estimate-wizard-form .wizard-step,
.estimate-wizard-form .wizard-assist-zone,
.estimate-wizard-form .assist-results,
.estimate-wizard-form .client-knowledge-panel,
.document-page-layout,
.document-form-shell,
.document-edit-shell,
.document-edit-form,
.document-edit-lines,
.assist-panel,
.assist-results,
.assist-card,
.wizard-review,
.document-result {
  min-width: 0;
}

.wizard-step .client-knowledge-panel,
.wizard-step .assist-panel,
.wizard-step [data-estimate-assist-results] {
  grid-column: 1 / -1;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.assist-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.assist-search-row,
.assist-panel .toolbar,
.document-edit-shell .heading-actions,
.document-edit-shell .compact-actions {
  min-width: 0;
  flex-wrap: wrap;
}

.assist-search-row button,
.assist-panel button,
.document-edit-shell button,
.document-edit-shell .button-link {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.document-edit-shell .document-lines {
  overflow-x: auto;
}

.document-edit-shell .document-line-toolbar {
  position: sticky;
  left: 0;
}

.document-edit-shell .document-result {
  margin-top: 0.75rem;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .estimate-wizard-form .button-row,
  .estimate-wizard-form .wizard-actions,
  .document-page-layout .heading-actions,
  .document-edit-shell .heading-actions,
  .document-edit-shell .compact-actions {
    width: 100%;
    justify-content: stretch;
  }
  .estimate-wizard-form .wizard-actions button,
  .document-page-layout .heading-actions .button-link,
  .document-edit-shell .heading-actions .button-link,
  .document-edit-shell .compact-actions button,
  .document-edit-shell .compact-actions .button-link,
  .recent-estimate-clone-button {
    width: 100%;
    justify-content: center;
  }
  .assist-search-row {
    align-items: stretch;
  }
}

/* v2.72.10: invoice list/edit/delivery layout hardening */
.invoice-delivery-heading,
.invoice-delivery-panel,
.invoice-delivery-card,
.invoice-delivery-card .section-header,
.invoice-delivery-card .toolbar,
#invoice-delivery-root,
#invoice-delivery-list,
#invoices-list {
  min-width: 0;
}

.invoice-delivery-heading .heading-actions,
.invoice-delivery-section-header {
  flex-wrap: wrap;
  min-width: 0;
}

.invoice-delivery-heading .heading-actions .button-link,
.invoice-delivery-section-header .button-link {
  max-width: 100%;
  white-space: normal;
  text-wrap: balance;
}

.invoice-delivery-card .kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
}

.invoice-delivery-search-toolbar,
.invoice-delivery-filter-toolbar {
  align-items: end;
  min-width: 0;
}

.invoice-delivery-search-toolbar input[type="search"] {
  flex: 1 1 280px;
  min-width: min(220px, 100%);
}

.invoice-delivery-search-toolbar button,
.invoice-delivery-filter-toolbar button {
  max-width: 100%;
  white-space: normal;
}

td.invoice-list-actions,
td.invoice-delivery-actions {
  min-width: min(260px, 100%);
  max-width: 100%;
  white-space: normal !important;
  align-items: flex-start;
}

td.invoice-list-actions > button,
td.invoice-list-actions > .button-link,
td.invoice-delivery-actions > button,
td.invoice-delivery-actions > .button-link {
  max-width: 100%;
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .invoice-delivery-heading .heading-actions,
  .invoice-delivery-section-header,
  .invoice-delivery-search-toolbar,
  .invoice-delivery-filter-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .invoice-delivery-heading .heading-actions .button-link,
  .invoice-delivery-section-header .button-link,
  .invoice-delivery-search-toolbar button,
  .invoice-delivery-filter-toolbar button {
    width: 100%;
  }
  .invoice-delivery-panel {
    padding-inline: 0.85rem;
  }
  td.invoice-list-actions,
  td.invoice-delivery-actions {
    width: 100%;
  }
}

/* v2.72.11: receivables / payables layout hardening */
.receivables-heading,
.payables-heading,
.receivables-page-layout,
.receivables-card,
.payables-summary-panel,
.payables-tax-panel,
.payables-list-panel,
#receivables-root,
#receivables-list,
#payables-list,
#payables-tax-quality,
#payables-tax-unset-list,
#payables-tax-issues-list {
  min-width: 0;
}

.receivables-heading .heading-actions,
.payables-heading .heading-actions,
.receivables-section-header,
.payables-tax-header,
.payables-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  min-width: 0;
}

.receivables-heading .heading-actions .button-link,
.payables-heading .heading-actions .button-link,
.receivables-section-header .button-link,
.payables-tax-header .button-link,
.payables-list-header .button-link {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.receivables-card .kpi-grid,
.payables-summary-panel .kpi-grid,
.payables-tax-panel .kpi-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
}

.receivables-filter-toolbar,
.payables-tax-toolbar,
.payables-filter-toolbar {
  min-width: 0;
  align-items: end;
}

.receivables-filter-toolbar button,
.payables-tax-toolbar button,
.payables-filter-toolbar button,
.payables-tax-toolbar select,
.payables-filter-toolbar input[type="search"],
.payables-filter-toolbar select {
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.payables-filter-toolbar input[type="search"] {
  flex: 1 1 260px;
  min-width: min(220px, 100%);
}

.payables-filter-toolbar select,
.payables-tax-toolbar select {
  flex: 1 1 220px;
  min-width: min(180px, 100%);
}

.receivables-table-wrap,
.payables-table-wrap,
.payables-tax-table-wrap {
  margin-top: 0.65rem;
}

td.receivables-list-actions,
td.payables-list-actions,
td.payables-tax-actions {
  min-width: min(240px, 100%);
  max-width: 100%;
  white-space: normal !important;
  align-items: flex-start;
}

td.receivables-list-actions > button,
td.receivables-list-actions > .button-link,
td.payables-list-actions > button,
td.payables-list-actions > .button-link,
td.payables-tax-actions > button,
td.payables-tax-actions > .button-link {
  max-width: 100%;
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
}

td.payables-select-cell {
  width: 3.5rem;
  text-align: center;
}

.payables-tax-panel .status-message,
.payables-tax-panel .form-hint,
.receivables-card .muted,
.payables-list-panel .muted,
.payables-tax-panel .muted {
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .receivables-heading .heading-actions,
  .payables-heading .heading-actions,
  .receivables-section-header,
  .payables-tax-header,
  .payables-list-header,
  .receivables-filter-toolbar,
  .payables-tax-toolbar,
  .payables-filter-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    width: 100%;
  }
  .receivables-heading .heading-actions .button-link,
  .payables-heading .heading-actions .button-link,
  .receivables-section-header .button-link,
  .receivables-filter-toolbar button,
  .payables-tax-toolbar button,
  .payables-filter-toolbar button,
  .payables-tax-toolbar select,
  .payables-filter-toolbar input[type="search"],
  .payables-filter-toolbar select {
    width: 100%;
  }
  .receivables-card,
  .payables-summary-panel,
  .payables-tax-panel,
  .payables-list-panel {
    padding-inline: 0.85rem;
  }
  td.receivables-list-actions,
  td.payables-list-actions,
  td.payables-tax-actions,
  td.payables-select-cell {
    width: 100%;
    text-align: left;
  }
}

/* v2.72.12: revenue schedule / recurring revenue / sales recognition layout hardening */
.revenue-heading .heading-actions,
.sales-recognition-heading .heading-actions,
.sales-recognition-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  min-width: 0;
}

.revenue-heading .heading-actions .button-link,
.sales-recognition-heading .heading-actions .button-link {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.revenue-page-layout,
.revenue-summary-panel,
.revenue-schedule-panel,
.recurring-contract-panel,
.revenue-schedules-panel,
.recurring-contracts-panel,
.sales-recognition-summary-panel,
.sales-recognition-list-panel,
#revenue-kpis,
#revenue-schedules-list,
#recurring-contracts-list,
#sales-recognition-kpis,
#sales-recognition-list {
  min-width: 0;
}

.revenue-summary-panel .kpi-grid,
.sales-recognition-summary-panel .kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
}

.revenue-form,
.revenue-form label,
.revenue-form .form-actions {
  min-width: 0;
}

.revenue-form label > input,
.revenue-form label > select,
.revenue-form label > textarea,
.sales-recognition-filter-toolbar label > input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.revenue-form .form-actions button,
.revenue-status-toolbar button,
.sales-recognition-filter-toolbar button,
td.revenue-schedule-actions button,
td.revenue-schedule-actions .button-link,
td.sales-recognition-actions button,
td.sales-recognition-actions .button-link {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.revenue-status-toolbar,
.sales-recognition-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
  min-width: 0;
}

.sales-recognition-filter-toolbar label {
  flex: 1 1 280px;
  min-width: min(240px, 100%);
}

.sales-recognition-filter-toolbar button,
.revenue-status-toolbar button {
  flex: 0 1 auto;
}

.revenue-schedules-table-wrap,
.recurring-contracts-table-wrap,
.sales-recognition-table-wrap {
  margin-top: 0.75rem;
}

.revenue-schedules-table-wrap table,
.recurring-contracts-table-wrap table,
.sales-recognition-table-wrap table {
  table-layout: auto;
}

.revenue-schedules-table-wrap th,
.revenue-schedules-table-wrap td,
.recurring-contracts-table-wrap th,
.recurring-contracts-table-wrap td,
.sales-recognition-table-wrap th,
.sales-recognition-table-wrap td {
  overflow-wrap: anywhere;
  min-width: 0;
}

td.revenue-schedule-actions,
td.sales-recognition-actions {
  min-width: min(220px, 100%);
  max-width: 100%;
  white-space: normal !important;
  align-items: flex-start;
}

.revenue-schedules-panel .muted,
.recurring-contracts-panel .muted,
.sales-recognition-list-panel .muted {
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .revenue-heading .heading-actions,
  .sales-recognition-heading .heading-actions,
  .revenue-status-toolbar,
  .sales-recognition-filter-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    width: 100%;
  }

  .revenue-heading .heading-actions .button-link,
  .sales-recognition-heading .heading-actions .button-link,
  .revenue-status-toolbar button,
  .sales-recognition-filter-toolbar label,
  .sales-recognition-filter-toolbar button {
    width: 100%;
  }

  .revenue-summary-panel,
  .revenue-schedule-panel,
  .recurring-contract-panel,
  .revenue-schedules-panel,
  .recurring-contracts-panel,
  .sales-recognition-summary-panel,
  .sales-recognition-list-panel {
    padding-inline: 0.85rem;
  }

  td.revenue-schedule-actions,
  td.sales-recognition-actions {
    width: 100%;
    text-align: left;
  }
}

/* v2.72.13: accounting workbench / period close layout hardening */
.accounting-workbench-heading,
.accounting-periods-heading {
  min-width: 0;
}
.accounting-workbench-heading .hero-actions,
.accounting-periods-heading .heading-actions {
  min-width: 0;
}
.accounting-workbench-heading .button-link,
.accounting-periods-heading .button-link {
  white-space: normal;
  text-align: center;
}
.accounting-workbench-page-layout,
.accounting-periods-panel,
.accounting-periods-grid,
.accounting-current-lock-card,
.accounting-period-settings-card,
.accounting-period-locks-panel,
.accounting-workbench-summary,
.accounting-workbench-close,
.accounting-workbench-section,
.accounting-monthly-tasks-panel,
.monthly-close-snapshot-panel {
  min-width: 0;
}
.accounting-workbench-section .section-header,
.accounting-workbench-summary .section-header,
.accounting-workbench-close .section-header,
.accounting-monthly-tasks-panel .section-header,
.monthly-close-check-panel .section-header,
.monthly-close-snapshot-panel .section-header,
.accounting-periods-panel .section-header {
  min-width: 0;
  gap: .85rem;
}
.accounting-workbench-section .section-header > div,
.accounting-workbench-summary .section-header > div,
.accounting-workbench-close .section-header > div,
.accounting-monthly-tasks-panel .section-header > div,
.monthly-close-check-panel .section-header > div,
.monthly-close-snapshot-panel .section-header > div {
  min-width: 0;
}
.accounting-workbench-section .section-header h2,
.accounting-workbench-summary .section-header h2,
.accounting-workbench-close .section-header h2,
.accounting-monthly-tasks-panel .section-header h2,
.monthly-close-check-panel .section-header h3,
.monthly-close-snapshot-panel .section-header h3 {
  overflow-wrap: anywhere;
}
.accounting-workbench-table-wrap,
.accounting-period-locks-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.accounting-workbench-table-wrap table,
.accounting-period-locks-table-wrap table {
  min-width: 0;
}
.accounting-workbench-table-wrap td,
.accounting-workbench-table-wrap th,
.accounting-period-locks-table-wrap td,
.accounting-period-locks-table-wrap th {
  overflow-wrap: anywhere;
}
.accounting-workbench-table-wrap .button-link,
.accounting-workbench-table-wrap button,
.accounting-period-locks-table-wrap .button-link,
.accounting-period-locks-table-wrap button {
  white-space: normal;
}
.accounting-next-step-grid.accounting-action-rail,
.accounting-next-step-grid {
  min-width: 0;
}
.accounting-next-step-grid .button-link {
  white-space: normal;
  min-width: 0;
}
.accounting-monthly-task-list {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}
.accounting-monthly-task,
.accounting-monthly-task-main,
.accounting-monthly-task .chip-row,
.monthly-close-snapshot-card,
.monthly-close-snapshot-card .chip-row {
  min-width: 0;
}
.accounting-monthly-task strong,
.accounting-monthly-task .subtext,
.monthly-close-snapshot-card strong,
.monthly-close-snapshot-card .subtext,
.monthly-close-check-panel .text-link,
.check-row .text-link {
  overflow-wrap: anywhere;
}
.accounting-monthly-actions,
.accounting-monthly-task-actions,
.monthly-close-snapshot-actions,
.accounting-period-actions {
  min-width: 0;
}
.accounting-monthly-actions > *,
.accounting-monthly-task-actions > *,
.monthly-close-snapshot-actions > *,
.accounting-period-actions > * {
  white-space: normal;
}
.accounting-period-form {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  align-items: start;
}
.accounting-period-form > label,
.accounting-period-form .accounting-lock-checkbox {
  min-width: 0;
}
.accounting-lock-checkbox {
  display: flex;
  gap: .45rem;
  align-items: flex-start;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.accounting-lock-checkbox input[type="checkbox"] {
  margin-top: .18rem;
  flex: 0 0 auto;
}
.accounting-period-form textarea,
.accounting-period-form input,
.accounting-period-form select {
  width: 100%;
  min-width: 0;
}
.accounting-period-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}
.accounting-period-actions-cell {
  min-width: 0;
}
.accounting-period-actions-cell button {
  max-width: 100%;
}
.monthly-close-snapshot-list {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}
.monthly-close-check-panel .check-row {
  min-width: 0;
}
.monthly-close-check-panel .check-row > * {
  min-width: 0;
}
@media (max-width: 760px) {
  .accounting-workbench-heading .hero-actions,
  .accounting-periods-heading .heading-actions,
  .accounting-next-step-grid,
  .accounting-monthly-actions,
  .accounting-period-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .accounting-workbench-heading .button-link,
  .accounting-periods-heading .button-link,
  .accounting-next-step-grid .button-link,
  .accounting-monthly-actions > *,
  .accounting-period-actions > * {
    width: 100%;
    justify-content: center;
  }
  .accounting-monthly-task-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .accounting-monthly-task-actions > *,
  .monthly-close-snapshot-actions > * {
    width: 100%;
    justify-content: center;
  }
}
@media (max-width: 640px) {
  .accounting-periods-grid.grid.two {
    grid-template-columns: 1fr;
  }
  .accounting-period-form {
    grid-template-columns: 1fr;
  }
}

/* v2.72.14 Android/mobile topbar auto-hide
   Large mobile browser chrome plus the full global header can leave little room
   for forms. On mobile only, the header collapses after inactivity and can be
   restored with a fixed small reveal button. */
.mobile-topbar-reveal {
  display: none;
}
@media (max-width: 760px) {
  body.mobile-topbar-autohide .topbar {
    max-height: 520px;
    overflow: hidden;
    transition: max-height .24s ease, padding .24s ease, opacity .2s ease, transform .24s ease, border-color .2s ease;
    will-change: max-height, transform, opacity;
  }
  body.mobile-topbar-autohide.mobile-topbar-collapsed .topbar {
    max-height: 0;
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-8px);
  }
  body.mobile-topbar-autohide.mobile-topbar-collapsed .page-context-bar {
    margin-top: .55rem;
  }
  .mobile-topbar-reveal {
    position: fixed;
    top: max(.55rem, env(safe-area-inset-top));
    left: .75rem;
    z-index: calc(var(--z-sticky) + 60);
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    max-width: calc(100vw - 1.5rem);
    padding: .5rem .82rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .42);
    background: rgba(15, 23, 42, .92);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .25);
    backdrop-filter: blur(14px);
  }
  body.mobile-topbar-collapsed .mobile-topbar-reveal {
    display: inline-flex;
  }
  body.mobile-topbar-collapsed .mobile-topbar-reveal:focus-visible {
    outline: 3px solid rgba(96, 165, 250, .85);
    outline-offset: 3px;
  }
  body.mobile-topbar-collapsed .container {
    margin-top: .85rem;
  }
  body.mobile-topbar-autohide.mobile-topbar-input-mode .topbar,
  body.mobile-topbar-autohide.mobile-topbar-input-mode.mobile-topbar-collapsed .topbar {
    max-height: 0 !important;
    min-height: 0 !important;
    height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
    border-bottom: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    transform: translateY(-10px) !important;
    transition: none !important;
  }
  body.mobile-topbar-input-mode .mobile-topbar-reveal {
    display: none !important;
  }
  body.mobile-topbar-input-mode .page-context-bar {
    display: none !important;
  }
  body.mobile-topbar-input-mode .container {
    margin-top: .25rem;
  }

}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  body.mobile-topbar-autohide .topbar,
  .mobile-topbar-reveal {
    transition: none;
  }
}

/* v2.72.22 freee pending duplicate UX hardening */
.freee-pending-duplicate-card {
  min-width: 0;
  overflow-wrap: anywhere;
}
.freee-pending-duplicate-card .compact-definition-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: .35rem .75rem;
  margin: .75rem 0;
}
.freee-pending-duplicate-card .compact-definition-list dt {
  color: var(--muted, #64748b);
  font-weight: 700;
}
.freee-pending-duplicate-card .compact-definition-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.checkbox-inline {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  line-height: 1.45;
}
.checkbox-inline input[type="checkbox"] {
  margin-top: .18rem;
  flex: 0 0 auto;
}
@media (max-width: 640px) {
  .freee-pending-duplicate-card .compact-definition-list {
    grid-template-columns: 1fr;
  }
  .freee-pending-duplicate-card .actions > * {
    width: 100%;
    justify-content: center;
  }
}

/* v2.72.23 safe/full export UI hardening */
.export-button-row,
.export-guard-panel .button-row,
.tenant-support-filter-bar .button-row {
  min-width: 0;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.export-guard-panel {
  min-width: 0;
}
.export-guard-panel .section-heading,
.notification-delivery-panel .section-heading-row,
.tenant-support-detail-panel .tenant-support-filter-bar {
  min-width: 0;
}
.export-button-row button,
.export-button-row .button-link,
.tenant-support-filter-bar button[data-export-mode] {
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  .export-button-row,
  .export-guard-panel .button-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .export-button-row button,
  .export-button-row .button-link,
  .tenant-support-filter-bar button[data-export-mode] {
    width: 100%;
  }
}


/* v2.73 sales order layout */
.sales-orders-layout { align-items: start; }
.sales-orders-panel, .sales-orders-heading { min-width: 0; }
.sales-orders-table-wrap { min-width: 0; overflow-x: auto; }
.sales-order-actions { flex-wrap: wrap; }
@media (max-width: 760px) {
  .sales-orders-layout { grid-template-columns: 1fr; }
  .sales-order-actions > button { width: 100%; white-space: normal; }
}

/* v2.73.8 sales order detail panel */
.sales-order-detail-panel {
  margin-top: 1rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.sales-order-detail-panel .section-heading-row {
  align-items: flex-start;
  gap: .75rem;
  flex-wrap: wrap;
}
.sales-order-detail-summary {
  margin: .75rem 0 1rem;
}
.sales-order-detail-lines-wrap {
  min-width: 0;
  overflow-x: auto;
}
@media (max-width: 760px) {
  .sales-order-detail-panel .sales-order-actions,
  .sales-order-detail-panel .sales-order-actions > button,
  .sales-order-detail-panel .sales-order-actions > .button-link {
    width: 100%;
  }
}

/* v2.74.6 optional purchase-order electronic seal preview */
.seal-preview {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.seal-preview img {
  max-width: 84px;
  max-height: 84px;
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 14px;
  background: #fff;
  padding: .35rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}

/* v2.75.7 tenant-admin privacy polish */
.masked-email {
  display: inline-block;
  max-width: 100%;
}
.masked-email summary {
  cursor: pointer;
  color: var(--muted);
  list-style: none;
  overflow-wrap: anywhere;
}
.masked-email summary::-webkit-details-marker {
  display: none;
}
.masked-email summary::after {
  content: " 表示";
  color: var(--link, #2563eb);
  font-size: .82em;
  margin-left: .25rem;
}
.masked-email[open] summary::after {
  content: " 隠す";
}
.masked-email code {
  display: inline-block;
  margin-top: .25rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* v2.75.13 UIUX P1 follow-up: workflow stepper, preflight signal, client wizard, bank account cards */
.workflow-stepper {
  display: grid;
  gap: .55rem;
  margin: .6rem 0 .85rem;
  min-width: 0;
}
.workflow-stepper-list {
  display: flex;
  gap: .45rem;
  align-items: stretch;
  list-style: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.workflow-step {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  gap: .22rem;
  justify-items: center;
  position: relative;
  color: var(--muted, #64748b);
}
.workflow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: .72rem;
  left: calc(50% + .9rem);
  right: calc(-50% + .9rem);
  height: 2px;
  background: var(--border, #dbe3ef);
  z-index: 0;
}
.workflow-step.done:not(:last-child)::after,
.workflow-step.current:not(:last-child)::after {
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}
.workflow-step-dot {
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  border: 2px solid var(--border, #dbe3ef);
  background: #fff;
  font-size: .75rem;
  font-weight: 800;
}
.workflow-step.done .workflow-step-dot,
.workflow-step.current .workflow-step-dot {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}
.workflow-step.current .workflow-step-dot {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .14);
}
.workflow-step-label {
  font-size: .78rem;
  text-align: center;
  overflow-wrap: anywhere;
}
.workflow-next-action {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  width: fit-content;
  padding: .45rem .7rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
  color: #1d4ed8;
  font-size: .88rem;
}
.workflow-next-action span {
  color: var(--muted, #64748b);
}
.workflow-stepper.compact {
  margin: .1rem 0 .35rem;
}
.workflow-stepper.compact .workflow-stepper-list {
  gap: .18rem;
}
.workflow-stepper.compact .workflow-step-label,
.workflow-stepper.compact .workflow-next-action {
  display: none;
}
.workflow-stepper.compact .workflow-step-dot {
  width: 1.05rem;
  height: 1.05rem;
  font-size: .55rem;
}
.workflow-stepper.compact .workflow-step:not(:last-child)::after {
  top: .52rem;
}

.preflight-signal-card {
  border-left-width: 6px;
}
.preflight-signal {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .75rem;
  align-items: center;
  padding: .8rem;
  border-radius: 18px;
  background: rgba(15, 23, 42, .04);
}
.preflight-signal.success { background: rgba(22, 163, 74, .08); }
.preflight-signal.warning { background: rgba(245, 158, 11, .1); }
.preflight-signal.danger { background: rgba(220, 38, 38, .08); }
.preflight-signal-icon {
  font-size: 1.8rem;
  line-height: 1;
}
.preflight-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .75rem;
  margin-top: .75rem;
}
.preflight-issue-list {
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 16px;
  padding: .75rem;
  background: #fff;
}
.preflight-issue-list h4 {
  margin: 0 0 .45rem;
}
.preflight-issue-list ul {
  margin: 0;
  padding-left: 1.1rem;
}
.preflight-issue-list li {
  margin: .35rem 0;
}
.preflight-issue-list small {
  display: block;
  color: var(--muted, #64748b);
}

.client-wizard-stepper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: .5rem;
  grid-column: 1 / -1;
  margin-bottom: .7rem;
}
.client-wizard-step {
  border: 1px solid var(--border, #dbe3ef);
  background: #fff;
  border-radius: 16px;
  padding: .65rem .75rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .2rem .55rem;
  text-align: left;
  color: inherit;
}
.client-wizard-step small {
  grid-column: 2;
  color: var(--muted, #64748b);
}
.client-wizard-step.current {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.client-wizard-step.done .client-wizard-step-number {
  background: #16a34a;
}
.client-wizard-step-number {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
}
.client-wizard-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.bank-account-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.bank-account-type-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: .5rem;
  margin-top: .35rem;
}
.bank-account-type-card {
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 16px;
  background: #fff;
  padding: .65rem .55rem;
  display: grid;
  justify-items: center;
  gap: .15rem;
  text-align: center;
  color: inherit;
  cursor: pointer;
}
.bank-account-type-card:hover,
.bank-account-type-card:focus-visible {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .14);
}
.bank-account-type-card.selected {
  border-color: #2563eb;
  background: rgba(37, 99, 235, .08);
}
.bank-account-type-icon {
  font-size: 1.35rem;
}
.bank-account-type-card small {
  color: var(--muted, #64748b);
  font-size: .72rem;
}
label:has([name="bank_account_type_other_note"]) {
  display: none;
}
label.bank-account-other-visible {
  display: grid;
}

.destructive-impact-preview {
  border: 1px solid rgba(220, 38, 38, .2);
  background: rgba(220, 38, 38, .06);
  border-radius: 16px;
  padding: .75rem;
}
.destructive-impact-preview ul {
  margin: .4rem 0 0;
  padding-left: 1.15rem;
}
.destructive-reason-input {
  width: 100%;
  min-height: 5rem;
}
.destructive-check-list {
  display: grid;
  gap: .45rem;
}
.destructive-check {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
}
.deal-quality-warnings.focused .warning-card.primary {
  border-color: #2563eb;
  background: rgba(37, 99, 235, .07);
}
.deal-quality-more summary {
  cursor: pointer;
  color: #2563eb;
  margin-top: .45rem;
}

@media (max-width: 640px) {
  .workflow-stepper-list {
    overflow-x: auto;
    padding-bottom: .25rem;
  }
  .workflow-step {
    min-width: 4.6rem;
  }
  .client-wizard-stepper,
  .bank-account-type-card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.document-list-toolbar {
  display: grid;
  gap: .7rem;
  margin: .75rem 0 1rem;
  padding: .8rem;
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 18px;
  background: rgba(248, 250, 252, .82);
}
.document-filter-form {
  display: grid;
  grid-template-columns: minmax(12rem, 1.4fr) repeat(3, minmax(9rem, 1fr)) auto;
  align-items: end;
  gap: .6rem;
}
.document-filter-form label {
  margin: 0;
}
.document-saved-view-bar {
  min-height: 1.8rem;
}
.document-saved-view-list {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  align-items: center;
}
.document-saved-view-chip {
  display: inline-flex;
  gap: .35rem;
  align-items: center;
  padding: .25rem .35rem;
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 999px;
  background: #fff;
}
.document-saved-view-meta {
  color: var(--muted, #64748b);
  font-size: .74rem;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 980px) {
  .document-filter-form {
    grid-template-columns: 1fr 1fr;
  }
  .document-filter-form .actions {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .document-filter-form {
    grid-template-columns: 1fr;
  }
  .document-saved-view-chip {
    width: 100%;
    justify-content: space-between;
    border-radius: 14px;
  }
}

/* v2.75.22: estimate wizard text overflow hardening */
.wizard-recommendation-card,
.wizard-method-grid,
.wizard-method-card,
.recommendation-main,
.recommendation-meta,
.recommendation-alternatives {
  min-width: 0;
  max-width: 100%;
}
.wizard-recommendation-card {
  grid-template-columns: minmax(0, 1fr) minmax(12rem, max-content);
}
.wizard-recommendation-card .recommendation-main strong,
.wizard-recommendation-card .recommendation-main p,
.wizard-recommendation-card .recommendation-meta,
.wizard-recommendation-card .recommendation-meta span,
.wizard-method-card,
.wizard-method-card strong,
.wizard-method-card span {
  overflow-wrap: anywhere;
  word-break: auto-phrase;
  white-space: normal;
}
.wizard-recommendation-card .recommendation-meta {
  max-width: min(24rem, 100%);
}
.wizard-recommendation-card .recommendation-meta .button,
.wizard-recommendation-card .recommendation-meta button,
.recommendation-alternatives .button,
.recommendation-alternatives button {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
@media (max-width: 760px) {
  .wizard-recommendation-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .wizard-recommendation-card .recommendation-meta {
    max-width: 100%;
  }
}

/* v2.75.25: estimate PDF / estimate wizard / deal form PC layout balance */
.wizard-recommendation-card,
.wizard-recommendation-card .recommendation-main,
.wizard-recommendation-card .recommendation-meta,
.wizard-recommendation-card .recommendation-alternatives,
.wizard-method-card,
.wizard-method-card strong,
.wizard-method-card span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

.wizard-recommendation-card .recommendation-meta {
  max-width: none;
}

.wizard-recommendation-card .recommendation-meta .button,
.wizard-recommendation-card .recommendation-meta button,
.recommendation-alternatives .button,
.recommendation-alternatives button {
  white-space: normal;
  text-align: left;
  line-height: 1.35;
}

@media (min-width: 1081px) {
  .estimate-wizard-form[data-wizard-step="3"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "progress"
      "summary"
      "step"
      "actions";
  }

  .estimate-wizard-form[data-wizard-step="3"] .estimate-wizard-live-summary {
    position: static;
  }

  .estimate-wizard-form[data-wizard-step="3"] .wizard-live-summary-card {
    grid-template-columns: minmax(0, 1.05fr) minmax(260px, .95fr);
    align-items: start;
  }

  .estimate-wizard-form[data-wizard-step="3"] .summary-card-head,
  .estimate-wizard-form[data-wizard-step="3"] .summary-signal-list {
    grid-column: 1;
  }

  .estimate-wizard-form[data-wizard-step="3"] .summary-metric-grid,
  .estimate-wizard-form[data-wizard-step="3"] .summary-profit-box {
    grid-column: 2;
  }
}

.estimate-wizard-form[data-wizard-step="3"] .document-lines,
.document-edit-shell .document-lines,
#document-edit-form .document-lines {
  max-width: 100%;
  overflow-x: visible;
}

.estimate-wizard-form[data-wizard-step="3"] .document-line-row,
.document-edit-shell .document-line-row,
#document-edit-form .document-line-row {
  min-width: 0;
  grid-template-columns:
    minmax(150px, 1.05fr)
    minmax(240px, 1.8fr)
    minmax(72px, .55fr)
    minmax(68px, .52fr)
    minmax(112px, .78fr)
    minmax(72px, .52fr)
    minmax(112px, .74fr)
    40px;
}

.estimate-wizard-form[data-wizard-step="3"] .document-line-row > *,
.document-edit-shell .document-line-row > *,
#document-edit-form .document-line-row > * {
  min-width: 0;
}

.estimate-wizard-form[data-wizard-step="3"] .document-line-row input,
.estimate-wizard-form[data-wizard-step="3"] .document-line-row select,
.document-edit-shell .document-line-row input,
.document-edit-shell .document-line-row select,
#document-edit-form .document-line-row input,
#document-edit-form .document-line-row select {
  width: 100%;
  min-width: 0;
}

.estimate-wizard-form[data-wizard-step="3"] .line-master-save,
.document-edit-shell .line-master-save,
#document-edit-form .line-master-save {
  grid-column: 1 / -1;
  min-width: 0;
}

@media (max-width: 1180px) {
  .estimate-wizard-form[data-wizard-step="3"] .document-line-row,
  .document-edit-shell .document-line-row,
  #document-edit-form .document-line-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .estimate-wizard-form[data-wizard-step="3"] .document-line-row .line-service-item,
  .estimate-wizard-form[data-wizard-step="3"] .document-line-row .line-description,
  .document-edit-shell .document-line-row .line-service-item,
  .document-edit-shell .document-line-row .line-description,
  #document-edit-form .document-line-row .line-service-item,
  #document-edit-form .document-line-row .line-description {
    grid-column: span 2;
  }

  .estimate-wizard-form[data-wizard-step="3"] .document-line-row .line-calculated,
  .document-edit-shell .document-line-row .line-calculated,
  #document-edit-form .document-line-row .line-calculated {
    grid-column: span 3;
  }
}

@media (max-width: 720px) {
  .estimate-wizard-form[data-wizard-step="3"] .wizard-live-summary-card,
  .estimate-wizard-form[data-wizard-step="3"] .document-line-row,
  .document-edit-shell .document-line-row,
  #document-edit-form .document-line-row {
    grid-template-columns: 1fr;
  }

  .estimate-wizard-form[data-wizard-step="3"] .document-line-row .line-service-item,
  .estimate-wizard-form[data-wizard-step="3"] .document-line-row .line-description,
  .estimate-wizard-form[data-wizard-step="3"] .document-line-row .line-calculated,
  .document-edit-shell .document-line-row .line-service-item,
  .document-edit-shell .document-line-row .line-description,
  .document-edit-shell .document-line-row .line-calculated,
  #document-edit-form .document-line-row .line-service-item,
  #document-edit-form .document-line-row .line-description,
  #document-edit-form .document-line-row .line-calculated {
    grid-column: 1 / -1;
  }
}

@media (min-width: 960px) {
  .deal-create-panel .deal-entry-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
  }

  .deal-create-panel .deal-entry-form > label,
  .deal-create-panel .deal-entry-form > button {
    min-width: 0;
  }

  .deal-create-panel .deal-entry-form > .deal-title-field {
    grid-column: span 2;
  }

  .deal-create-panel .deal-entry-form > label.full,
  .deal-create-panel .deal-entry-form > .full {
    grid-column: 1 / -1;
  }
}
.estimate-wizard-form[data-wizard-step="3"] .document-line-toolbar {
  position: static;
  bottom: auto;
  left: auto;
}

/* v2.75.24: desktop global menu accordion/dropdown and top-safe overlays */
html {
  scroll-padding-top: calc(var(--topbar-height, 72px) + 1rem);
}
#main-content,
[data-section],
[id] {
  scroll-margin-top: calc(var(--topbar-height, 72px) + 1rem);
}
.guide-overlay {
  z-index: var(--z-modal) !important;
  padding-top: max(1.25rem, env(safe-area-inset-top));
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}
.guide-panel {
  max-height: calc(100dvh - 2.5rem);
  max-height: calc(100vh - 2.5rem);
}

.global-nav .nav-dropdown-panel {
  min-width: 0;
}
.global-nav .nav-dropdown-panel > a {
  display: block;
  padding: .48rem .68rem;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}
.global-nav .nav-dropdown-panel > a:hover,
.global-nav .nav-dropdown-panel > a:focus-visible {
  background: rgba(255,255,255,.12);
  text-decoration: none;
}
.global-nav .nav-dropdown-panel > a[data-require-role][hidden],
.global-nav .nav-dropdown-panel > .nav-section-heading[data-require-role][hidden] {
  display: none !important;
}
.global-nav .nav-dropdown-panel .nav-section-heading {
  display: block;
  margin: .55rem .55rem .22rem;
  padding-top: .42rem;
  border-top: 1px solid rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .68);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  pointer-events: none;
}
.global-nav .nav-dropdown-panel .nav-section-heading:first-child {
  border-top: none;
  padding-top: .18rem;
}

@media (min-width: 761px) {
  .topbar {
    align-items: center;
    overflow: visible;
  }
  .global-nav {
    position: static;
    overflow: visible;
  }
  .global-nav details {
    position: static;
    min-width: auto;
    padding-bottom: 0;
  }
  .global-nav details[open] {
    min-width: auto !important;
    padding-bottom: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  .global-nav details[open] summary {
    background: rgba(255,255,255,.16);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  }
  .global-nav details[open] > .nav-dropdown-panel {
    position: fixed;
    top: var(--nav-panel-top, calc(var(--topbar-height, 64px) + .5rem));
    left: var(--nav-panel-left, 1rem);
    z-index: var(--z-dropdown);
    display: block;
    width: max-content;
    min-width: 13.5rem;
    max-width: min(22rem, calc(100vw - 1.5rem));
    max-height: var(--nav-panel-max-height, calc(100dvh - var(--topbar-height, 64px) - 1rem));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: .55rem;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 18px;
    background: rgba(12, 20, 35, .97);
    color: #fff;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .36);
    backdrop-filter: blur(18px) saturate(1.2);
    scrollbar-gutter: stable;
  }
  .global-nav details[open] > .nav-dropdown-panel::-webkit-scrollbar {
    width: .55rem;
  }
  .global-nav details[open] > .nav-dropdown-panel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.24);
    border-radius: 999px;
  }
}

@media (max-width: 760px) {
  .global-nav details[open] > .nav-dropdown-panel {
    display: grid;
    gap: .1rem;
    width: min(100%, 23rem);
    max-height: min(64vh, calc(100dvh - 8rem));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: .45rem;
  }
  .global-nav details[open] > .nav-dropdown-panel > a {
    min-width: 0;
    margin: 0 .25rem;
  }
}



/* v2.75.35: mobile global navigation drawer hardening.
   When a long category such as Operations is open on mobile, keep the topbar
   itself scrollable and free the bottom viewport area so every link remains
   reachable. */
@media (max-width: 760px) {
  body.mobile-topbar-autohide.global-nav-menu-open .topbar {
    max-height: calc(100dvh - .75rem) !important;
    min-height: 0 !important;
    height: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)) !important;
    scrollbar-gutter: stable;
  }
  body.global-nav-menu-open .mobile-bottom-nav,
  body.global-nav-menu-open .mobile-topbar-reveal {
    display: none !important;
  }
  body.mobile-topbar-autohide.global-nav-menu-open .page-context-bar {
    display: none !important;
  }
  body.mobile-topbar-autohide.global-nav-menu-open .container {
    margin-top: .75rem;
  }
  body.mobile-topbar-autohide.global-nav-menu-open .global-nav {
    width: 100%;
    max-height: none;
    overflow: visible;
    align-items: stretch;
    gap: .5rem;
  }
  body.mobile-topbar-autohide.global-nav-menu-open .global-nav details[open] {
    width: 100%;
    min-width: 0;
  }
  body.mobile-topbar-autohide.global-nav-menu-open .global-nav details[open] > summary {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(51, 65, 85, .96);
    backdrop-filter: blur(12px);
  }
  body.mobile-topbar-autohide.global-nav-menu-open .global-nav details[open] > .nav-dropdown-panel {
    width: 100%;
    max-width: 100%;
    max-height: max(14rem, calc(100dvh - 13.5rem));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    scrollbar-gutter: stable;
  }
  body.mobile-topbar-autohide.global-nav-menu-open .global-nav details[open] > .nav-dropdown-panel > a {
    display: block;
    min-height: 42px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 420px) {
  body.mobile-topbar-autohide.global-nav-menu-open .global-nav details[open] > .nav-dropdown-panel {
    max-height: max(12rem, calc(100dvh - 12rem));
  }
}

/* v2.75.25: collapsed page guidance and form layout stabilization */
.page-context-disclosure {
  padding: 0;
  overflow: clip;
}
.page-context-disclosure > summary {
  list-style: none;
}
.page-context-disclosure > summary::-webkit-details-marker {
  display: none;
}
.page-context-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
  cursor: pointer;
  padding: .78rem .95rem;
  border-radius: 18px;
  min-width: 0;
}
.page-context-summary:hover,
.page-context-disclosure[open] > .page-context-summary {
  background: rgba(37, 99, 235, .06);
}
.page-context-summary-main {
  min-width: 0;
}
.page-context-summary .breadcrumb,
.page-context-summary .page-context-title {
  overflow-wrap: anywhere;
}
.page-context-summary-hint {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #1d4ed8;
  padding: .32rem .58rem;
  font-size: .78rem;
  font-weight: 850;
}
.page-context-summary-hint::after {
  content: '⌄';
  font-size: .88rem;
  line-height: 1;
}
.page-context-disclosure[open] .page-context-summary-hint::after {
  content: '⌃';
}
.page-context-disclosure[open] .page-context-summary-hint {
  color: #334155;
}
.page-context-expanded {
  display: grid;
  gap: .75rem;
  padding: 0 .95rem .95rem;
}
.page-context-main.expanded {
  align-items: flex-start;
}
@media (max-width: 760px) {
  .page-context-summary {
    align-items: flex-start;
    display: grid;
  }
  .page-context-summary-hint {
    width: fit-content;
  }
}

@media (min-width: 960px) {
  .deal-create-panel .deal-entry-form {
    align-items: start;
    row-gap: 1rem;
  }
  .deal-create-panel .deal-entry-form label {
    position: relative;
    display: grid;
    gap: .42rem;
    align-content: start;
  }
  .deal-create-panel .deal-entry-form input,
  .deal-create-panel .deal-entry-form select,
  .deal-create-panel .deal-entry-form textarea {
    min-width: 0;
    width: 100%;
  }
  .deal-create-panel .deal-entry-form .form-hint {
    position: absolute;
    left: 0;
    top: calc(100% + .28rem);
    z-index: 3;
    max-width: min(28rem, 72vw);
    padding: .38rem .55rem;
    border: 1px solid rgba(191, 219, 254, .75);
    border-radius: 10px;
    background: rgba(239, 246, 255, .98);
    color: #1e3a8a;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .12);
    line-height: 1.45;
    opacity: 0;
    transform: translateY(-.2rem);
    pointer-events: none;
    transition: opacity .14s ease, transform .14s ease;
  }
  .deal-create-panel .deal-entry-form label:hover .form-hint,
  .deal-create-panel .deal-entry-form label:focus-within .form-hint {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 959px) {
  .deal-create-panel .deal-entry-form .form-hint {
    display: block;
    margin-top: .28rem;
    line-height: 1.45;
  }
}

/* v2.75.35: mobile form overflow and checkbox layout hardening.
   Long checkbox labels and dense accounting/recurring revenue forms must never
   squeeze into one-character columns or create hidden horizontal overflow. */
@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  .container {
    width: min(100% - 1rem, 1440px);
    max-width: 100%;
  }

  body.mobile-topbar-autohide.mobile-topbar-collapsed:not(.mobile-topbar-input-mode):not(.global-nav-menu-open):not(.command-palette-open) .container {
    margin-top: max(4.75rem, calc(env(safe-area-inset-top) + 4.25rem));
  }

  .surface-grid,
  .surface-grid.reverse,
  .page-two-column,
  .polished-two-column,
  .revenue-page-layout,
  .revenue-form,
  .grid-form {
    grid-template-columns: minmax(0, 1fr) !important;
    inline-size: 100%;
    max-inline-size: 100%;
  }

  .panel,
  .card,
  .page-card,
  .polished-card,
  .revenue-page-layout > *,
  .grid-form > *,
  .revenue-form > *,
  .form-grid > * {
    min-width: 0;
    max-width: 100%;
  }

  .grid-form > label,
  .revenue-form > label,
  .form-grid > label {
    display: grid;
    gap: .36rem;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .grid-form input,
  .grid-form select,
  .grid-form textarea,
  .revenue-form input,
  .revenue-form select,
  .revenue-form textarea,
  .form-grid input,
  .form-grid select,
  .form-grid textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .checkbox-inline,
  label.checkbox-inline {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: .5rem;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .checkbox-inline > input[type="checkbox"] {
    margin-top: .18rem;
    justify-self: start;
  }

  .checkbox-inline > span,
  .checkbox-inline > .checkbox-label {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
    line-height: 1.45;
  }

  .revenue-automation-panel .form-actions,
  .recurring-contract-panel .form-actions,
  .revenue-schedule-panel .form-actions,
  .grid-form .form-actions,
  .revenue-form .form-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .65rem;
    width: 100%;
    min-width: 0;
  }

  .revenue-automation-panel .form-actions > *,
  .recurring-contract-panel .form-actions > *,
  .revenue-schedule-panel .form-actions > *,
  .grid-form .form-actions > *,
  .revenue-form .form-actions > * {
    width: 100%;
    justify-content: center;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .revenue-page-layout .table-wrap,
  .revenue-schedules-table-wrap,
  .recurring-contracts-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 420px) {
  .panel,
  .card,
  .page-card {
    border-radius: 18px;
  }
  .grid-form,
  .revenue-form,
  .form-grid {
    gap: .85rem;
  }
}

/* v2.75.30: tenant admin bootstrap/access guidance */
.tenant-admin-access-hero code,
.tenant-admin-access-panel code {
  background: rgba(37, 99, 235, .08);
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: .45rem;
  padding: .08rem .32rem;
}
.tenant-access-definition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: .8rem;
}
.tenant-access-definition-grid > div {
  border: 1px solid var(--border-color, rgba(148, 163, 184, .28));
  border-radius: .85rem;
  padding: .85rem;
  background: var(--surface-muted, rgba(248, 250, 252, .72));
}
.tenant-access-definition-grid dt {
  color: var(--muted-text, #64748b);
  font-size: .82rem;
  margin-bottom: .25rem;
}
.tenant-access-definition-grid dd {
  font-weight: 700;
  margin: 0;
  overflow-wrap: anywhere;
}
.setup-checklist {
  display: grid;
  gap: .45rem;
  padding-left: 1.35rem;
}
.tenant-user-create-panel .code-block,
.tenant-admin-access-panel .code-block {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .tenant-user-create-panel .grid.three-columns,
  .tenant-access-definition-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* v2.75.35: accounting today-focus home and recurring invoice queue */
.accounting-today-focus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 1.25rem;
  align-items: stretch;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(239, 246, 255, 0.94));
}
.accounting-today-focus::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: #2563eb;
}
.accounting-today-focus-danger::before { background: #dc2626; }
.accounting-today-focus-warning::before { background: #f59e0b; }
.accounting-today-focus-success::before { background: #16a34a; }
.accounting-focus-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  min-width: 0;
}
.accounting-focus-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 1rem;
  background: rgba(37, 99, 235, 0.10);
  font-size: 1.45rem;
}
.accounting-focus-copy,
.accounting-focus-copy h2,
.accounting-focus-copy p {
  min-width: 0;
  overflow-wrap: anywhere;
}
.accounting-focus-copy h2 {
  margin: .1rem 0 .3rem;
  font-size: clamp(1.35rem, 2vw, 2rem);
}
.accounting-focus-side {
  display: grid;
  gap: .55rem;
  align-content: center;
  justify-items: stretch;
  min-width: 0;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
}
.accounting-focus-metric-label {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.accounting-focus-metric-value {
  font-size: clamp(1.25rem, 2.2vw, 1.85rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.accounting-focus-side .button-link {
  justify-content: center;
  text-align: center;
  white-space: normal;
}
@media (max-width: 780px) {
  .accounting-today-focus {
    grid-template-columns: 1fr;
    gap: .9rem;
  }
  .accounting-focus-main {
    grid-template-columns: 1fr;
  }
  .accounting-focus-icon {
    width: 2.75rem;
    height: 2.75rem;
  }
}

/* v2.75.34 accounting monthly-close readiness preview */
.accounting-close-readiness {
  border: 1px solid rgba(15, 23, 42, .09);
  overflow: hidden;
}
.accounting-close-readiness-danger {
  border-color: rgba(220, 38, 38, .35);
  background: linear-gradient(135deg, rgba(254, 242, 242, .96), rgba(255, 255, 255, .98));
}
.accounting-close-readiness-warning {
  border-color: rgba(245, 158, 11, .32);
  background: linear-gradient(135deg, rgba(255, 251, 235, .96), rgba(255, 255, 255, .98));
}
.accounting-close-readiness-success {
  border-color: rgba(34, 197, 94, .28);
  background: linear-gradient(135deg, rgba(240, 253, 244, .96), rgba(255, 255, 255, .98));
}
.accounting-close-readiness-actions {
  align-items: center;
  flex-wrap: wrap;
}
.accounting-close-readiness-list {
  display: grid;
  gap: .55rem;
  margin-top: .85rem;
}
.accounting-close-readiness-list .check-row {
  align-items: center;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 14px;
  display: grid;
  gap: .45rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: .65rem .75rem;
}
.accounting-close-readiness-list .check-row .text-link {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 720px) {
  .accounting-close-readiness-list .check-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .accounting-close-readiness-actions .button-link,
  .accounting-close-readiness-actions button {
    width: 100%;
  }
}

/* v2.75.34 accounting billing follow-up queue */
.accounting-followup-action {
  display: grid;
  gap: .25rem;
  min-width: 0;
}
.accounting-followup-action .subtext,
.accounting-followup-action small {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* v2.75.35: recurring billing check/readiness panel */
.recurring-billing-check-panel .section-header {
  align-items: flex-start;
  gap: 1rem;
}
.recurring-billing-readiness {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin: .8rem 0 1rem;
  padding: 1rem;
  border: 1px solid var(--border-soft, #d7e1ee);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(236, 245, 255, .95), rgba(255,255,255,.95));
  box-shadow: var(--shadow-sm, 0 8px 24px rgba(15, 23, 42, .08));
}
.recurring-billing-readiness.warning {
  border-color: rgba(245, 158, 11, .35);
  background: linear-gradient(135deg, rgba(255, 247, 237, .97), rgba(255,255,255,.96));
}
.recurring-billing-readiness.success {
  border-color: rgba(34, 197, 94, .28);
  background: linear-gradient(135deg, rgba(240, 253, 244, .97), rgba(255,255,255,.96));
}
.recurring-billing-readiness h3 {
  margin: .15rem 0 .25rem;
  font-size: clamp(1.08rem, 2vw, 1.45rem);
}
.recurring-billing-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
}
.recurring-billing-check-grid .mini-panel {
  min-width: 0;
  overflow: hidden;
}
.recurring-billing-check-grid .mini-panel.full-width {
  grid-column: 1 / -1;
}
.recurring-check-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.recurring-check-table-wrap table {
  min-width: 720px;
}
@media (max-width: 900px) {
  .recurring-billing-readiness,
  .recurring-billing-check-panel .section-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .recurring-billing-check-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .recurring-billing-readiness {
    padding: .85rem;
    border-radius: 16px;
  }
  .recurring-billing-readiness .accounting-focus-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }
}

/* v2.75.35: migration diff preview / dry-run manifest layout */
.migration-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 1rem;
  align-items: start;
}

.migration-preview-card {
  border: 1px solid var(--border-subtle, #d8dee9);
  border-radius: 16px;
  background: var(--surface-muted, #f8fafc);
  padding: 1rem;
  min-width: 0;
}

.migration-manifest-textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .86rem;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.migration-preview-result,
.migration-diff-table-wrap,
.migration-manifest-table-wrap {
  margin-top: .75rem;
  max-width: 100%;
  overflow-x: auto;
}

.migration-preview-fields {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: .18rem .5rem;
  margin: 0;
  min-width: 0;
  font-size: .82rem;
}

.migration-preview-fields dt {
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.migration-preview-fields dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.migration-manifest-headline {
  display: flex;
  gap: .5rem;
  align-items: baseline;
  flex-wrap: wrap;
  padding: .65rem .75rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle, #d8dee9);
  margin: .5rem 0;
}

.migration-manifest-headline.success {
  background: rgba(16, 185, 129, .08);
  border-color: rgba(16, 185, 129, .25);
}

.migration-manifest-headline.danger {
  background: rgba(239, 68, 68, .08);
  border-color: rgba(239, 68, 68, .25);
}

.migration-manifest-warnings {
  margin: .5rem 0;
  padding-left: 1.1rem;
  color: var(--warning-text, #92400e);
}

@media (max-width: 860px) {
  .migration-preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .migration-preview-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .migration-preview-fields dt {
    white-space: normal;
    font-weight: 700;
  }
}

/* v2.75.36 receivable collection review / payment difference reasons */
.collection-review-dialog-detail {
  display: grid;
  gap: .75rem;
  min-width: min(32rem, 100%);
}
.collection-review-dialog-detail label {
  display: grid;
  gap: .35rem;
}
.receivables-filter-toolbar {
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .collection-review-dialog-detail {
    min-width: 0;
  }
}


/* v2.75.38 receivable invoice timeline / accounting audit visibility */
.invoice-timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .85rem;
  max-height: min(70dvh, 42rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.invoice-timeline-event {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: .65rem;
  min-width: 0;
}

.invoice-timeline-marker {
  width: .78rem;
  height: .78rem;
  border-radius: 999px;
  margin-top: .35rem;
  background: var(--border-strong, #94a3b8);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, .14);
}

.invoice-timeline-body {
  border: 1px solid var(--border-subtle, #d8dee9);
  border-radius: 14px;
  padding: .75rem .85rem;
  background: var(--surface-raised, #fff);
  min-width: 0;
}

.invoice-timeline-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: baseline;
  flex-wrap: wrap;
  min-width: 0;
}

.timeline-description,
.timeline-detail,
.timeline-amount {
  margin: .35rem 0 0;
  overflow-wrap: anywhere;
}

.timeline-amount {
  font-weight: 700;
}

.invoice-timeline-event.timeline-danger .invoice-timeline-marker { background: var(--danger, #dc2626); box-shadow: 0 0 0 4px rgba(220, 38, 38, .14); }
.invoice-timeline-event.timeline-warning .invoice-timeline-marker { background: var(--warning, #d97706); box-shadow: 0 0 0 4px rgba(217, 119, 6, .14); }
.invoice-timeline-event.timeline-success .invoice-timeline-marker { background: var(--success, #059669); box-shadow: 0 0 0 4px rgba(5, 150, 105, .14); }
.invoice-timeline-event.timeline-info .invoice-timeline-marker { background: var(--info, #2563eb); box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); }

@media (max-width: 640px) {
  .invoice-timeline-list {
    max-height: min(72dvh, 34rem);
  }
  .invoice-timeline-event {
    grid-template-columns: .8rem minmax(0, 1fr);
    gap: .45rem;
  }
  .invoice-timeline-body {
    padding: .65rem .7rem;
  }
}

/* v2.75.38 accounting settings checklist */
.accounting-settings-checklist {
  border: 1px solid rgba(148, 163, 184, .26);
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,250,252,.94));
}
.accounting-settings-checklist-danger {
  border-color: rgba(239, 68, 68, .32);
  box-shadow: 0 18px 45px rgba(239, 68, 68, .08);
}
.accounting-settings-checklist-warning {
  border-color: rgba(245, 158, 11, .34);
  box-shadow: 0 18px 45px rgba(245, 158, 11, .08);
}
.accounting-settings-checklist-success {
  border-color: rgba(34, 197, 94, .28);
}
.accounting-settings-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: .85rem;
  margin-top: .9rem;
}
.accounting-settings-check-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .85rem;
  min-width: 0;
  padding: .85rem;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 16px;
  background: rgba(255,255,255,.82);
}
.accounting-settings-check-row.blocker {
  border-color: rgba(239, 68, 68, .28);
  background: rgba(254, 242, 242, .72);
}
.accounting-settings-check-row.warning {
  border-color: rgba(245, 158, 11, .3);
  background: rgba(255, 251, 235, .72);
}
.accounting-settings-check-row.ok {
  border-color: rgba(34, 197, 94, .24);
  background: rgba(240, 253, 244, .66);
}
.accounting-settings-check-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .65rem;
  min-width: 0;
}
.accounting-settings-check-main strong,
.accounting-settings-check-main p,
.accounting-settings-check-main small {
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  .accounting-settings-check-grid { grid-template-columns: minmax(0, 1fr); }
  .accounting-settings-check-row { flex-direction: column; }
  .accounting-settings-check-row .button-link { width: 100%; justify-content: center; }
}

/* v2.75.39: 支払・買掛タイムライン */
.payable-timeline-list .timeline-amount,
.invoice-timeline-list .timeline-amount {
  font-weight: 700;
}
.payables-list-actions .button-link,
.payables-list-actions button {
  min-width: 0;
}

/* v2.75.42 freee issue triage board */
.freee-sync-log-card {
  border: 1px solid var(--border-color, #d9e2ef);
  border-radius: 16px;
  padding: 1rem;
  background: var(--surface, #fff);
}
.freee-sync-log-card.danger {
  border-color: rgba(220, 38, 38, .35);
  background: rgba(254, 242, 242, .72);
}
.freee-sync-log-card.warning {
  border-color: rgba(217, 119, 6, .35);
  background: rgba(255, 251, 235, .74);
}
.freee-problem-log-table-wrap {
  overflow-x: auto;
}
@media (max-width: 760px) {
  .freee-sync-log-card .section-head {
    align-items: flex-start;
    gap: .7rem;
  }
  .freee-problem-log-table-wrap {
    max-width: 100%;
  }
}

/* v2.75.45 freee sync log triage filters */
.freee-log-filter-toolbar {
  align-items: end;
  gap: .75rem;
  margin: .75rem 0 1rem;
}
.freee-log-table-wrap .actions,
.freee-problem-log-table-wrap .actions {
  flex-wrap: wrap;
}

/* v2.75.49 freee log summary */
.freee-log-summary {
  margin: .85rem 0 1rem;
}
.freee-log-summary-grid {
  align-items: stretch;
}
.freee-log-summary-kpi.danger {
  border-color: rgba(220, 38, 38, .35);
  background: rgba(254, 242, 242, .78);
}
.freee-log-summary-kpi.warning {
  border-color: rgba(217, 119, 6, .35);
  background: rgba(255, 251, 235, .78);
}
.freee-log-summary-kpi.success {
  border-color: rgba(22, 163, 74, .30);
  background: rgba(240, 253, 244, .70);
}
@media (max-width: 760px) {
  .freee-log-summary-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* v2.75.53 dashboard KPI goal narrative/ring follow-up */
.dashboard-goal-overview-card {
  margin-top: 1.1rem;
}
.dashboard-goal-overview-inner {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(0, 1.5fr);
  gap: 1rem;
  align-items: stretch;
}
.dashboard-goal-narrative {
  border-radius: 20px;
  padding: 1.05rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, .04), rgba(14, 165, 233, .08));
  border: 1px solid var(--border);
}
.dashboard-goal-narrative h3 {
  margin: .15rem 0 .45rem;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
}
.dashboard-goal-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .8rem 0 1rem;
}
.dashboard-goal-ring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .8rem;
}
.dashboard-goal-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .9rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: .9rem;
  background: rgba(255,255,255,.92);
  box-shadow: 0 6px 24px rgba(15,23,42,.07);
  min-width: 0;
}
body.theme-dark .dashboard-goal-card,
body.theme-dark .dashboard-goal-narrative {
  background: rgba(15, 23, 42, .72);
}
.goal-ring {
  width: 74px;
  height: 74px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--surface) 0 56%, transparent 57%),
    conic-gradient(var(--primary) var(--goal-ring-progress, 0deg), rgba(148,163,184,.28) 0deg);
  color: var(--primary);
  font-weight: 900;
  flex: none;
}
.goal-ring.success { background: radial-gradient(circle at center, var(--surface) 0 56%, transparent 57%), conic-gradient(var(--success) var(--goal-ring-progress, 0deg), rgba(148,163,184,.28) 0deg); color: var(--success); }
.goal-ring.warning { background: radial-gradient(circle at center, var(--surface) 0 56%, transparent 57%), conic-gradient(var(--warning) var(--goal-ring-progress, 0deg), rgba(148,163,184,.28) 0deg); color: var(--warning); }
.goal-ring.danger { background: radial-gradient(circle at center, var(--surface) 0 56%, transparent 57%), conic-gradient(var(--danger) var(--goal-ring-progress, 0deg), rgba(148,163,184,.28) 0deg); color: var(--danger); }
.goal-ring-value { font-size: .95rem; letter-spacing: -.04em; }
.dashboard-goal-card-body { min-width: 0; display: grid; gap: .25rem; }
.dashboard-goal-card-title {
  display: flex;
  gap: .45rem;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
}
.dashboard-goal-card-title strong,
.dashboard-goal-headline {
  overflow-wrap: anywhere;
}
.dashboard-goal-headline {
  margin: 0;
  font-weight: 900;
  color: var(--text);
}
.compact-link {
  width: fit-content;
  padding: .35rem .6rem;
  font-size: .82rem;
}
.compact-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 1rem;
}
@media (max-width: 760px) {
  .dashboard-goal-overview-inner {
    grid-template-columns: 1fr;
  }
  .dashboard-goal-card {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}

/* v2.75.53 mobile one-tap action center */
.mobile-actions-hero {
  align-items: center;
}
.mobile-actions-panel {
  display: grid;
  gap: 1rem;
}
.mobile-action-focus {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(14, 165, 233, .08));
  box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
  min-width: 0;
}
.mobile-action-focus.danger { background: linear-gradient(135deg, rgba(220, 38, 38, .1), rgba(249, 115, 22, .08)); }
.mobile-action-focus.warning { background: linear-gradient(135deg, rgba(245, 158, 11, .12), rgba(14, 165, 233, .06)); }
.mobile-action-focus.success { background: linear-gradient(135deg, rgba(22, 163, 74, .12), rgba(14, 165, 233, .06)); }
.mobile-action-focus h2 {
  margin: .1rem 0 .45rem;
  font-size: clamp(1.25rem, 5vw, 1.7rem);
}
.mobile-action-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}
.mobile-action-quick-card {
  display: grid;
  gap: .25rem;
  min-width: 0;
  padding: .85rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
.mobile-action-quick-card:hover,
.mobile-action-quick-card:focus {
  text-decoration: none;
  border-color: rgba(37, 99, 235, .45);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .12);
}
.mobile-action-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(37, 99, 235, .1);
  font-size: 1.2rem;
}
.mobile-action-section {
  display: grid;
  gap: .75rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1rem;
  background: rgba(255,255,255,.9);
  min-width: 0;
}
body.theme-dark .mobile-action-section,
body.theme-dark .mobile-action-quick-card {
  background: rgba(15, 23, 42, .74);
}
.mobile-action-list {
  display: grid;
  gap: .7rem;
}
.mobile-action-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: .85rem;
  background: var(--surface);
  min-width: 0;
}
.mobile-action-card.danger { border-color: rgba(220, 38, 38, .35); }
.mobile-action-card.warning { border-color: rgba(245, 158, 11, .38); }
.mobile-action-card.success { border-color: rgba(22, 163, 74, .35); }
.mobile-action-card-main,
.mobile-action-card-title {
  min-width: 0;
}
.mobile-action-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.mobile-action-card-title strong {
  overflow-wrap: anywhere;
}
.mobile-action-meta-row,
.mobile-action-card-actions,
.mobile-action-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}
.mobile-action-card-actions {
  justify-content: flex-end;
}
.mobile-action-link-grid .button-link {
  width: auto;
}
@media (max-width: 760px) {
  .mobile-actions-hero {
    padding: 1rem;
  }
  .mobile-action-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mobile-action-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .mobile-action-card-actions .button-link,
  .mobile-action-card-actions button,
  .mobile-action-link-grid .button-link {
    width: 100%;
    justify-content: center;
  }
}
@media (max-width: 420px) {
  .mobile-action-quick-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* v2.75.66: Android/mobile keyboard topbar hardening.
   Input mode must win over global-nav-open, reveal, bottom nav and page context
   even when visualViewport/toggle events race on Android Chrome. */
@media (max-width: 760px) {
  body.mobile-topbar-autohide.mobile-topbar-input-mode .topbar,
  body.mobile-topbar-autohide.mobile-topbar-keyboard-active .topbar,
  body.mobile-topbar-autohide.mobile-topbar-input-mode.mobile-topbar-collapsed .topbar,
  body.mobile-topbar-autohide.mobile-topbar-keyboard-active.mobile-topbar-collapsed .topbar,
  body.mobile-topbar-autohide.mobile-topbar-input-mode.global-nav-menu-open .topbar,
  body.mobile-topbar-autohide.mobile-topbar-keyboard-active.global-nav-menu-open .topbar {
    max-height: 0 !important;
    min-height: 0 !important;
    height: 0 !important;
    padding-block: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    transform: translateY(-12px) !important;
    transition: none !important;
  }

  body.mobile-topbar-input-mode .mobile-topbar-reveal,
  body.mobile-topbar-keyboard-active .mobile-topbar-reveal,
  body.mobile-topbar-input-mode .mobile-bottom-nav,
  body.mobile-topbar-keyboard-active .mobile-bottom-nav,
  body.mobile-topbar-input-mode .page-context-bar,
  body.mobile-topbar-keyboard-active .page-context-bar {
    display: none !important;
  }

  body.mobile-topbar-input-mode.global-nav-menu-open,
  body.mobile-topbar-keyboard-active.global-nav-menu-open {
    overflow-x: clip;
  }

  body.mobile-topbar-input-mode .container,
  body.mobile-topbar-keyboard-active .container {
    margin-top: .25rem !important;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}

/* v2.75.66: deal timeline filters / deep-link timeline items */
.deal-timeline-shell {
  display: grid;
  gap: .85rem;
}
.deal-timeline-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}
.deal-timeline-filter-bar .button-link,
.deal-timeline-filter-bar button {
  min-height: 34px;
}
.deal-timeline-filter-bar .active,
.deal-timeline-filter-bar [aria-pressed="true"] {
  background: rgba(37, 99, 235, .12);
  border-color: rgba(37, 99, 235, .32);
  color: #1d4ed8;
}
.deal-timeline-list [hidden] {
  display: none !important;
}
.timeline-title .strong-link {
  font-weight: 900;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .deal-timeline-filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: .15rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }
  .deal-timeline-filter-bar button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* v2.75.66: deal timeline search/date filters and CSV current filter support */
.deal-timeline-search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  min-width: 0;
}
.deal-timeline-search-bar input[type="search"] {
  flex: 1 1 18rem;
  min-width: min(100%, 14rem);
}
.deal-timeline-search-bar input[type="date"] {
  flex: 0 1 10.5rem;
  min-width: 0;
}
.deal-timeline-toolbar {
  align-items: stretch;
}
@media (max-width: 760px) {
  .deal-timeline-search-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .deal-timeline-search-bar input[type="search"],
  .deal-timeline-search-bar input[type="date"] {
    width: 100%;
    min-width: 0;
  }
}

/* v2.75.66: deal timeline clear filter / no-result guidance */
.deal-timeline-export-note {
  margin: .1rem 0 0;
  flex: 1 1 100%;
}
.deal-timeline-empty {
  margin: 0;
  padding: .85rem 1rem;
  border: 1px dashed rgba(148, 163, 184, .7);
  border-radius: 14px;
  background: rgba(248, 250, 252, .9);
}
[data-deal-timeline-clear].is-disabled {
  opacity: .5;
}

/* v2.75.66: server-side deal timeline refresh status */
.deal-timeline-status {
  margin: 0;
  color: var(--muted-foreground, #64748b);
}

/* v2.75.66: deal timeline shareable filters and date-range validation */
.deal-timeline-status[data-tone="warning"] {
  color: #b45309;
  font-weight: 700;
}
.deal-timeline-status[data-tone="muted"] {
  color: var(--muted-foreground, #64748b);
}

/* v2.75.66: accessibility first pass */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.global-nav a[aria-current="page"],
.mobile-bottom-nav-item[aria-current="page"] {
  text-decoration: none;
}
.modal-overlay [role="dialog"],
.command-palette-overlay[role="dialog"],
.guide-overlay[role="dialog"] {
  outline: none;
}
@media (forced-colors: active) {
  button:focus-visible,
  a:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  summary:focus-visible {
    outline: 2px solid Highlight;
  }
  .badge,
  .status-badge,
  .signal-badge {
    border: 1px solid CanvasText;
  }
}

/* v2.75.66: accessibility second pass - form error summary and keyboard modal hardening */
.form-error-summary {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #7f1d1d;
  border-radius: 12px;
  padding: .75rem .9rem;
  margin: 0 0 1rem;
}
.form-error-summary:focus {
  outline: 3px solid rgba(239, 68, 68, .35);
  outline-offset: 2px;
}
.form-error-summary ul {
  margin: .45rem 0 0 1.2rem;
  padding: 0;
}
.form-error-summary a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}
.field-error[id] {
  display: block;
}
@media (forced-colors: active) {
  .form-error-summary {
    border: 2px solid Mark;
  }
}

/* v2.76.0: optional desktop side navigation. Keeps the existing topbar as the
   default, while letting PC users switch to a stable left rail from 表示設定. */
:root { --desktop-side-nav-width: 278px; }
.desktop-side-nav {
  position: fixed;
  top: var(--topbar-height, 64px);
  left: 0;
  bottom: 0;
  z-index: calc(var(--z-sticky) - 1);
  width: var(--desktop-side-nav-width);
  padding: 1rem .85rem 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: color-mix(in srgb, var(--panel) 96%, var(--bg));
  color: var(--text);
  border-right: 1px solid var(--line);
  box-shadow: 14px 0 34px rgba(15, 23, 42, .06);
  scrollbar-gutter: stable;
}
.desktop-side-nav[hidden] { display: none !important; }
.desktop-side-nav-head {
  display: grid;
  gap: .35rem;
  margin-bottom: .8rem;
  padding: .25rem .35rem .75rem;
  border-bottom: 1px solid var(--line);
}
.desktop-side-nav-kicker {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .1em;
}
.desktop-side-nav .desktop-side-nav-body {
  display: grid;
  gap: .35rem;
}
.desktop-side-nav a,
.desktop-side-nav summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: .52rem .65rem;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.desktop-side-nav a:hover,
.desktop-side-nav a:focus-visible,
.desktop-side-nav summary:hover,
.desktop-side-nav summary:focus-visible,
.desktop-side-nav a.is-active {
  background: #eef2ff;
  color: #1d4ed8;
  text-decoration: none;
}
.desktop-side-nav details { border-radius: 14px; }
.desktop-side-nav details[open] { background: color-mix(in srgb, var(--bg) 74%, var(--panel)); }
.desktop-side-nav summary { cursor: pointer; list-style: none; }
.desktop-side-nav summary::-webkit-details-marker { display: none; }
.desktop-side-nav summary::after { content: '▾'; color: var(--muted); font-size: .8rem; }
.desktop-side-nav details[open] summary::after { content: '▴'; }
.desktop-side-nav .nav-dropdown-panel {
  display: grid;
  gap: .12rem;
  padding: .15rem .15rem .55rem .55rem;
}
.desktop-side-nav .nav-dropdown-panel > a {
  padding: .44rem .58rem;
  margin-left: .25rem;
  font-weight: 700;
  font-size: .92rem;
}
.desktop-side-nav .nav-section-heading {
  display: block;
  margin: .65rem .55rem .16rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
}
body.ui-side-nav .global-nav > a:not(.nav-quick-link):not(#tenant-context-chip),
body.ui-side-nav .global-nav > details,
body.ui-side-nav .global-nav .nav-separator {
  display: none !important;
}
body.ui-side-nav .page-context-bar,
body.ui-side-nav .container {
  width: min(1180px, calc(100% - var(--desktop-side-nav-width) - 2.5rem));
  margin-left: calc(var(--desktop-side-nav-width) + 1.25rem);
  margin-right: 1.25rem;
}
body.ui-side-nav.ui-wide .page-context-bar,
body.ui-side-nav.ui-wide .container {
  width: min(1480px, calc(100% - var(--desktop-side-nav-width) - 2.5rem));
}
[data-theme="dark"] .desktop-side-nav,
body.theme-dark .desktop-side-nav {
  background: rgba(15, 23, 42, .98);
  color: #f8fafc;
  border-right-color: rgba(148, 163, 184, .24);
  box-shadow: 16px 0 38px rgba(0, 0, 0, .32);
}
[data-theme="dark"] .desktop-side-nav a,
[data-theme="dark"] .desktop-side-nav summary,
body.theme-dark .desktop-side-nav a,
body.theme-dark .desktop-side-nav summary { color: #f8fafc; }
[data-theme="dark"] .desktop-side-nav a:hover,
[data-theme="dark"] .desktop-side-nav a:focus-visible,
[data-theme="dark"] .desktop-side-nav summary:hover,
[data-theme="dark"] .desktop-side-nav summary:focus-visible,
[data-theme="dark"] .desktop-side-nav a.is-active,
body.theme-dark .desktop-side-nav a:hover,
body.theme-dark .desktop-side-nav a:focus-visible,
body.theme-dark .desktop-side-nav summary:hover,
body.theme-dark .desktop-side-nav summary:focus-visible,
body.theme-dark .desktop-side-nav a.is-active {
  background: rgba(37, 99, 235, .22);
  color: #bfdbfe;
}
[data-theme="dark"] .desktop-side-nav details[open],
body.theme-dark .desktop-side-nav details[open] { background: rgba(30, 41, 59, .72); }
@media (max-width: 1023px) {
  .desktop-side-nav { display: none !important; }
  body.ui-side-nav .page-context-bar,
  body.ui-side-nav .container {
    width: min(1180px, calc(100% - 2rem));
    margin-left: auto;
    margin-right: auto;
  }
  body.ui-side-nav .global-nav > a:not(.nav-quick-link):not(#tenant-context-chip),
  body.ui-side-nav .global-nav > details,
  body.ui-side-nav .global-nav .nav-separator {
    display: revert !important;
  }
}

/* v2.76.0: desktop side navigation search/filter second pass. */
.desktop-side-nav-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .45rem;
  align-items: center;
  margin: 0 0 .75rem;
  padding: 0 .25rem .7rem;
  border-bottom: 1px solid var(--line);
}
.desktop-side-nav-search input[type="search"] {
  min-width: 0;
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, var(--panel));
  color: var(--text);
  padding: .52rem .72rem;
  font: inherit;
  font-size: .92rem;
}
.desktop-side-nav-search input[type="search"]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 44%, transparent);
  outline-offset: 2px;
}
.desktop-side-nav-empty {
  margin: .2rem .35rem .8rem;
  padding: .65rem .7rem;
  border-radius: 12px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 78%, var(--panel));
  font-size: .9rem;
}
.desktop-side-nav.is-filtering details[open] {
  background: color-mix(in srgb, var(--accent) 7%, var(--bg));
}
[data-theme="dark"] .desktop-side-nav-search input[type="search"],
body.theme-dark .desktop-side-nav-search input[type="search"] {
  background: rgba(15, 23, 42, .8);
  border-color: rgba(148, 163, 184, .28);
  color: #f8fafc;
}
[data-theme="dark"] .desktop-side-nav-empty,
body.theme-dark .desktop-side-nav-empty {
  background: rgba(15, 23, 42, .6);
  border-color: rgba(148, 163, 184, .28);
  color: #cbd5e1;
}
@media (forced-colors: active) {
  .desktop-side-nav-search input[type="search"],
  .desktop-side-nav-empty {
    border: 1px solid CanvasText;
  }
}

/* v2.76.0: desktop side navigation open-state persistence and group controls. */
.desktop-side-nav-group-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}
.desktop-side-nav-group-actions .tiny {
  padding: .38rem .55rem;
  font-size: .78rem;
}
@media (max-width: 1023px) {
  .desktop-side-nav-group-actions { display: none !important; }
}
[data-theme="dark"] .desktop-side-nav-group-actions .secondary,
body.theme-dark .desktop-side-nav-group-actions .secondary {
  background: rgba(15, 23, 42, .72);
  color: #dbeafe;
  border-color: rgba(148, 163, 184, .28);
}


/* v2.75.74 KAI Assist side panel */
.kai-assist-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 5000);
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.32);
  padding: clamp(0.5rem, 2vw, 1.25rem);
}

.kai-assist-panel {
  width: min(440px, 100%);
  max-height: calc(100dvh - 1rem);
  overflow: auto;
  border-radius: 24px;
  background: var(--surface, #fff);
  color: var(--text, #111827);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  border: 1px solid var(--border, #e5e7eb);
}

.kai-assist-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  background: color-mix(in srgb, var(--surface, #fff) 94%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.kai-assist-header h2 { margin: 0.1rem 0; }
.kai-assist-body { display: grid; gap: 0.85rem; padding: 1rem; }
.kai-assist-card { border: 1px solid var(--border, #e5e7eb); background: var(--surface-subtle, #f8fafc); border-radius: 18px; padding: 0.95rem; }
.kai-assist-card h3 { margin: 0 0 0.45rem; }
.kai-assist-action-grid, .kai-assist-recent-list { display: grid; gap: 0.5rem; }
.kai-assist-recent-link { display: block; padding: 0.55rem 0.7rem; border: 1px solid var(--border, #e5e7eb); border-radius: 12px; background: var(--surface, #fff); color: inherit; text-decoration: none; }
.kai-assist-recent-link:hover, .kai-assist-recent-link:focus-visible { border-color: var(--accent, #2563eb); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #2563eb) 18%, transparent); }
body.theme-dark .kai-assist-panel, [data-theme="dark"] .kai-assist-panel { background: var(--surface, #111827); color: var(--text, #f9fafb); border-color: var(--border, #334155); }
body.theme-dark .kai-assist-card, [data-theme="dark"] .kai-assist-card { background: var(--surface-subtle, #0f172a); border-color: var(--border, #334155); }
body.theme-dark .kai-assist-recent-link, [data-theme="dark"] .kai-assist-recent-link { background: var(--surface, #111827); border-color: var(--border, #334155); }
@media (max-width: 760px) { .kai-assist-overlay { padding: 0; align-items: stretch; } .kai-assist-panel { width: 100%; max-height: 100dvh; border-radius: 0; } }

/* v2.75.74 KAI Assist checklist */
.kai-assist-checklist { display: grid; gap: 0.55rem; }
.kai-assist-checklist-items { display: grid; gap: 0.45rem; }
.kai-assist-check-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--surface, #fff);
  cursor: pointer;
}
.kai-assist-check-item span { min-width: 0; overflow-wrap: anywhere; }
.kai-assist-check-item.is-complete span { text-decoration: line-through; color: var(--muted, #64748b); }
.kai-assist-check-item:focus-within { outline: 3px solid color-mix(in srgb, var(--accent, #2563eb) 30%, transparent); outline-offset: 2px; }
body.theme-dark .kai-assist-check-item,
[data-theme="dark"] .kai-assist-check-item { background: var(--surface, #111827); border-color: var(--border, #334155); }

/* v2.76.0 KAI Assist notes */
/* v2.76.0 KAI Assist notes autosave */
.kai-assist-checklist-actions { margin-top: 0.15rem; }
.kai-assist-note { display: grid; gap: 0.5rem; }
.kai-assist-note-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  resize: vertical;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--text, #111827);
  padding: 0.7rem 0.8rem;
  line-height: 1.55;
}
.kai-assist-note-input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent, #2563eb) 30%, transparent);
  outline-offset: 2px;
  border-color: var(--accent, #2563eb);
}
body.theme-dark .kai-assist-note-input,
[data-theme="dark"] .kai-assist-note-input {
  background: var(--surface, #111827);
  color: var(--text, #f9fafb);
  border-color: var(--border, #334155);
}

/* v2.76.0 KAI Assist note autosave */
.kai-assist-note-status {
  margin: 0;
}
.kai-assist-note-status[data-tone="pending"] { color: var(--warning, #b45309); }
.kai-assist-note-status[data-tone="warning"] { color: var(--danger, #b91c1c); }
.kai-assist-note-status[data-tone="success"] { color: var(--success, #047857); }
body.theme-dark .kai-assist-note-status[data-tone="pending"],
[data-theme="dark"] .kai-assist-note-status[data-tone="pending"] { color: #fbbf24; }
body.theme-dark .kai-assist-note-status[data-tone="warning"],
[data-theme="dark"] .kai-assist-note-status[data-tone="warning"] { color: #fca5a5; }
body.theme-dark .kai-assist-note-status[data-tone="success"],
[data-theme="dark"] .kai-assist-note-status[data-tone="success"] { color: #86efac; }

/* v2.76.0 KAI Assist saved note index */
.kai-assist-saved-notes,
.kai-assist-saved-note-list { display: grid; gap: 0.5rem; }
.kai-assist-saved-note-link {
  display: block;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.kai-assist-saved-note-link:hover,
.kai-assist-saved-note-link:focus-visible {
  border-color: var(--accent, #2563eb);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #2563eb) 18%, transparent);
}
body.theme-dark .kai-assist-saved-note-link,
[data-theme="dark"] .kai-assist-saved-note-link {
  background: var(--surface, #111827);
  border-color: var(--border, #334155);
}

/* v2.76.0 KAI Assist saved note management */
.kai-assist-saved-note-search {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--text, #111827);
  padding: 0.58rem 0.7rem;
}
.kai-assist-saved-note-search:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent, #2563eb) 28%, transparent);
  outline-offset: 2px;
  border-color: var(--accent, #2563eb);
}
.kai-assist-saved-note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: stretch;
}
.kai-assist-saved-note-row > .kai-assist-saved-note-link { min-width: 0; }
.kai-assist-saved-note-row > button { align-self: stretch; }
body.theme-dark .kai-assist-saved-note-search,
[data-theme="dark"] .kai-assist-saved-note-search {
  background: var(--surface, #111827);
  color: var(--text, #f9fafb);
  border-color: var(--border, #334155);
}
@media (max-width: 640px) {
  .kai-assist-saved-note-row { grid-template-columns: minmax(0, 1fr); }
  .kai-assist-saved-note-row > button { width: 100%; }
}

/* v2.76.0 KAI Assist saved note JSON import/export */
.kai-assist-saved-note-actions {
  align-items: stretch;
  flex-wrap: wrap;
}
.kai-assist-saved-note-actions > button {
  min-width: 8rem;
}


/* v2.76.0 Design System first pass */
.design-system-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 1rem;
  align-items: stretch;
}
.design-system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.design-token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
}
.design-token-card {
  border: 1px solid var(--border-color, #d7dee8);
  border-radius: 14px;
  background: var(--surface-color, #fff);
  padding: .8rem;
  min-height: 110px;
}
.design-swatch {
  display: block;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, .12);
  margin-bottom: .6rem;
}
.design-swatch.primary { background: var(--color-primary, #2563eb); }
.design-swatch.success { background: var(--color-success, #16a34a); }
.design-swatch.warning { background: var(--color-warning, #d97706); }
.design-swatch.danger { background: var(--color-danger, #dc2626); }
.design-swatch.surface { background: var(--surface-color, #ffffff); }
.design-swatch.muted { background: var(--muted-surface, #f4f7fb); }
.design-example-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
}
.design-spec-list {
  margin: .3rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted-text, #64748b);
}
.design-component-slab {
  border: 1px solid var(--border-color, #d7dee8);
  border-radius: 16px;
  padding: 1rem;
  background: var(--surface-color, #fff);
}
.design-mini-form {
  display: grid;
  gap: .65rem;
  max-width: 560px;
}
.design-mini-table {
  width: 100%;
  border-collapse: collapse;
}
.design-mini-table th,
.design-mini-table td {
  border-bottom: 1px solid var(--border-color, #d7dee8);
  padding: .55rem .65rem;
  text-align: left;
}
body.theme-dark .design-token-card,
body.theme-dark .design-component-slab,
[data-theme="dark"] .design-token-card,
[data-theme="dark"] .design-component-slab {
  background: var(--surface-color, #111827);
  border-color: var(--border-color, #334155);
}
@media (max-width: 760px) {
  .design-system-hero { grid-template-columns: 1fr; }
}

/* v2.76.0 Design System token export / CSP-safe numeric alignment */
.design-numeric {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}
.design-token-json-note {
  display: grid;
  gap: .35rem;
}
