/* Presales customer data room & internal presales workspace styles. */

/* === Shared Icon System (Tabler outline masks) === */
.brand-mark,
.glyph {
  display: inline-block;
  flex: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.brand-mark::after,
.glyph {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.brand-mark::after {
  --icon: url('/icons/tabler/layout-dashboard.svg');
  color: #fff;
  width: 17px;
  height: 17px;
}

.icon-file-text { --icon: url('/icons/tabler/file-text.svg'); }
.icon-file-type-pdf { --icon: url('/icons/tabler/file-type-pdf.svg'); }
.icon-browser { --icon: url('/icons/tabler/browser.svg'); }
.icon-link { --icon: url('/icons/tabler/link.svg'); }
.icon-search { --icon: url('/icons/tabler/search.svg'); }
.icon-external { --icon: url('/icons/tabler/arrow-up-right.svg'); }
.icon-arrow { --icon: url('/icons/tabler/arrow-right.svg'); }
.icon-back { --icon: url('/icons/tabler/arrow-right.svg'); transform: scaleX(-1); }
.icon-lock { --icon: url('/icons/tabler/lock.svg'); }
.icon-photo { --icon: url('/icons/tabler/photo.svg'); }
.icon-download { --icon: url('/icons/tabler/download.svg'); }
.icon-package { --icon: url('/icons/tabler/package.svg'); }
.icon-eye { --icon: url('/icons/tabler/eye.svg'); }
.icon-x { --icon: url('/icons/tabler/x.svg'); }
.icon-copy { --icon: url('/icons/tabler/copy.svg'); }
.icon-check { --icon: url('/icons/tabler/check.svg'); }
.icon-sparkles { --icon: url('/icons/tabler/sparkles.svg'); }

/* === Distinct Corporate Format Tones === */
.tone-docs { --tone: #1e40af; --tint: #eff6ff; --tone-line: #bfdbfe; }
.tone-text { --tone: #334155; --tint: #f1f5f9; --tone-line: #cbd5e1; }
.tone-pdf { --tone: #b91c1c; --tint: #fef2f2; --tone-line: #fecaca; }
.tone-prototype { --tone: #0f766e; --tint: #f0fdfa; --tone-line: #99f6e4; }
.tone-links { --tone: #6d28d9; --tint: #f5f3ff; --tone-line: #ddd6fe; }
.tone-images { --tone: #0369a1; --tint: #f0f9ff; --tone-line: #bae6fd; }
.tone-files { --tone: #b45309; --tint: #fffbeb; --tone-line: #fde68a; }
.tone-ai { --tone: #4f46e5; --tint: #eef2ff; --tone-line: #c7d2fe; }

/* === Public Read-Only Share Shell === */
.room {
  color-scheme: light;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ebf1f9 0%, #f4f7fb 210px);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.room-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-top: 2px solid #1e40af;
  border-bottom: 1px solid #dfe7f1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.035);
}

.room-bar-inner {
  width: 100%;
  max-width: none;
  min-height: 58px;
  margin: 0 auto;
  padding: 0 clamp(16px, 2.2vw, 36px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.room-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
}

.room-brand strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.room-brand-link:hover {
  text-decoration: none;
}

.room-brand-link:hover strong {
  color: #1e40af;
}

.bar-slash {
  color: #cbd5e1;
  font-weight: 400;
}

.room-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  color: #475569;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

.room-mode .glyph {
  width: 13px;
  height: 13px;
  color: #64748b;
}

.presale-public {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: clamp(20px, 2.4vw, 28px) clamp(16px, 2.2vw, 36px) 36px;
  overflow-wrap: anywhere;
}

.presale-public:has(.room-reader) {
  padding-top: 16px;
  padding-bottom: 12px;
}

.room-foot {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 6px clamp(16px, 2.2vw, 36px) 20px;
  text-align: center;
}

.room-foot p {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid #e4ebf4;
  color: #94a3b8;
  font-size: 12px;
  letter-spacing: 0.015em;
}

/* === Shared Elevated Surfaces & Executive Hero === */
.catalog-hero,
.sales-banner,
.file-panel,
.pipeline-wrap,
.sales-props,
.sales-card,
.reader-card {
  background: var(--surface);
  border: 1px solid #dfe7f1;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035), 0 6px 20px rgba(15, 23, 42, 0.025);
}

.catalog-hero,
.sales-banner {
  position: relative;
  overflow: hidden;
  padding: 22px 26px 22px 30px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 66%, #f4f8ff 100%);
}

.catalog-hero::before,
.sales-banner::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #2563eb 0%, #1e3a8a 100%);
}

.catalog-hero::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 240px;
  height: 100%;
  pointer-events: none;
  background-image: radial-gradient(rgba(30, 64, 175, 0.065) 1px, transparent 1px);
  background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(270deg, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
  mask-image: linear-gradient(270deg, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
}

.catalog-heading,
.sales-banner-title {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
}

.catalog-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #1e40af;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.catalog-hero h1 {
  margin: 7px 0 0;
  font-size: clamp(22px, 2.4vw, 27px);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.catalog-brief {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: #64748b;
}

.catalog-metrics {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  margin: 0;
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.85);
  border: 1px solid #e6edf6;
}

.catalog-metrics > div {
  padding: 2px 18px;
  border-left: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.catalog-metrics > div:first-child {
  border-left: 0;
  padding-left: 0;
}

.catalog-metrics > div:last-child {
  padding-right: 0;
}

.catalog-metrics dt {
  font-size: 11.5px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.3;
  white-space: nowrap;
}

.catalog-metrics dd {
  margin: 6px 0 0;
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.catalog-metrics dd strong {
  font-size: 20px;
  line-height: 1.15;
  font-weight: 700;
  color: #0f172a;
}

.catalog-metrics .metric-date dd strong {
  font-size: 15.5px;
  font-weight: 650;
  color: #1e293b;
  line-height: 1.45;
}

.catalog-metrics dd small {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

/* === Catalog Panel, Category Tabs & Search === */
.file-panel,
.pipeline-wrap,
.sales-props,
.sales-card,
.reader-card {
  overflow: hidden;
}

.file-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  min-height: 56px;
  border-bottom: 1px solid #e2e8f0;
  background: var(--surface);
}

.file-tools nav {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  gap: 16px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.file-tools nav::-webkit-scrollbar {
  display: none;
}

.file-tools nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  white-space: nowrap;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.file-tools nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background-color 0.15s ease;
}

.file-tools nav a:hover {
  color: #1e40af;
  text-decoration: none;
}

.file-tools nav a[aria-current] {
  color: #1e40af;
  font-weight: 650;
}

.file-tools nav a[aria-current]::after {
  background: #2563eb;
}

.file-tools nav small {
  font: 600 11.5px/1.45 system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 22px;
  text-align: center;
}

.file-tools nav [aria-current] small {
  background: #dbeafe;
  color: #1e40af;
}

.file-search {
  display: flex;
  align-items: center;
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  height: 36px;
  width: 252px;
  flex-shrink: 0;
  background: #f8fafc;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.file-search:hover {
  border-color: #c4d1e0;
  background: #fff;
}

.file-search:focus-within {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.file-search input[type=search] {
  width: 100%;
  min-width: 0;
  font-size: 13px;
  border: 0;
  outline: 0;
  padding: 0 10px 0 0;
  background: transparent;
  color: var(--ink);
}

.file-search input[type=search]::placeholder {
  color: #94a3b8;
}

.file-search button {
  width: 34px;
  height: 100%;
  flex: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #64748b;
  border: 0;
  background: transparent;
}

.file-search button:hover {
  color: #1e40af;
}

.file-search button .glyph {
  width: 15px;
  height: 15px;
}

.search-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 22px;
  font-size: 13px;
  color: #334155;
  background: #f8fbff;
  border-bottom: 1px solid #dbeafe;
}

.search-state a {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #bfdbfe;
  background: #fff;
  color: #1e40af;
  font-size: 12px;
  font-weight: 550;
  text-decoration: none;
}

.search-state a:hover {
  background: #eff6ff;
  text-decoration: none;
}

/* === Material Table === */
.file-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}

.file-table th,
.file-table td {
  border-bottom: 1px solid #eef2f7;
  padding: 13px 22px;
  vertical-align: middle;
}

.file-table thead th {
  background: #f8fafc;
  font-size: 12px;
  line-height: 18px;
  color: #64748b;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding-block: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.file-table .type-cell {
  width: 124px;
}

.file-table .size-cell {
  width: 92px;
  text-align: right;
  font-size: 13px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.file-table .date-cell {
  width: 130px;
  text-align: right;
  white-space: nowrap;
}

.file-table .action-cell {
  width: 112px;
  text-align: right;
  white-space: nowrap;
}

.file-table tbody tr {
  position: relative;
  transition: background-color 0.14s ease, box-shadow 0.14s ease;
}

.file-table tbody th {
  white-space: normal;
  background: transparent;
  font-weight: 400;
  color: var(--ink);
}

.file-table tbody tr:last-child > * {
  border-bottom: 0;
}

.file-table tbody tr:has(a):is(:hover, :focus-within) {
  background: #f8fbff;
  box-shadow: inset 3px 0 0 #2563eb;
}

.file-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 40px;
  color: var(--ink);
  text-decoration: none;
}

a.file-entry::after {
  content: "";
  position: absolute;
  inset: 0;
}

a.file-entry:hover {
  color: #1e40af;
  text-decoration: none;
}

.file-entry:focus-visible {
  outline-offset: 4px;
  border-radius: 6px;
}

.file-caption {
  min-width: 0;
  overflow-wrap: anywhere;
}

.file-caption strong {
  display: block;
  font-size: 14.5px;
  line-height: 1.48;
  font-weight: 600;
  color: inherit;
}

.file-host,
.file-mobile-meta {
  color: var(--muted);
  display: block;
  font-weight: 400;
  font-size: 12px;
  margin-top: 2px;
}

.file-mobile-meta {
  display: none;
}

.file-tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  color: var(--tone);
  background: var(--tint);
  border: 1px solid var(--tone-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.15s ease;
}

.file-table tbody tr:has(a):is(:hover, :focus-within) .file-tile {
  transform: scale(1.03);
}

.file-tile .glyph {
  width: 20px;
  height: 20px;
}

.file-type {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.4;
  color: var(--tone);
  background: var(--tint);
  border: 1px solid var(--tone-line);
  white-space: nowrap;
}

.date-cell time {
  font-size: 13px;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.open-file {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  margin-right: -10px;
  border-radius: 6px;
  border: 1px solid transparent;
  color: #1e40af;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.open-file .glyph {
  width: 14px;
  height: 14px;
  transition: transform 0.14s ease;
}

.file-table tbody tr:has(a):is(:hover, :focus-within) .open-file {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.file-table tbody tr:has(a):is(:hover, :focus-within) .open-file .icon-arrow {
  transform: translateX(2px);
}

.file-table tbody tr:has(a):is(:hover, :focus-within) .open-file .icon-external {
  transform: translate(1px, -1px);
}

.action-muted {
  color: #94a3b8;
  font-size: 12.5px;
}

.file-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 22px;
  background: #fafbfd;
  border-top: 1px solid #eef2f7;
  font-size: 12px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.file-panel-foot strong {
  color: #334155;
  font-weight: 600;
}

.file-panel-foot a {
  margin-left: 8px;
  color: #1e40af;
  font-weight: 550;
}

/* === Empty & Status States === */
.room-empty {
  padding: 56px 24px;
  text-align: center;
  background: var(--surface);
}

.room-empty-compact {
  padding: 36px 20px;
}

.empty-emblem,
.status-emblem {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 13px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #dfe7f1;
  color: #64748b;
  box-shadow: inset 0 1px 0 #fff;
}

.empty-emblem .glyph,
.status-emblem .glyph {
  width: 22px;
  height: 22px;
}

.empty-title {
  margin: 14px 0 6px;
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
}

.empty-desc {
  margin: 0 auto;
  max-width: 420px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

.empty-action {
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  padding: 7px 15px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
}

.empty-action:hover {
  background: #dbeafe;
  text-decoration: none;
}

.room-status-card {
  max-width: 460px;
  margin: clamp(40px, 10vh, 92px) auto;
  padding: 40px 32px 30px;
  text-align: center;
  background: var(--surface);
  border: 1px solid #dfe7f1;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.045);
}

.room-status-card h1 {
  margin: 18px 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.room-status-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.status-meta {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #eef2f7;
  font-size: 12px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

/* === Single-Document Reader View === */
.room-reader {
  width: 100%;
  max-width: none;
  margin: 0 auto;
}

.reader-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.reader-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 8px;
  border: 1px solid #d8e1ec;
  background: var(--surface);
  color: #334155;
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.back-btn .glyph {
  width: 15px;
  height: 15px;
}

.back-btn:hover {
  border-color: #bfdbfe;
  color: #1e40af;
  background: #f8fbff;
  text-decoration: none;
}

.reader-sep {
  color: #cbd5e1;
}

.reader-crumb {
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-pager {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
}

.pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 550;
  color: #334155;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.pager-btn .glyph {
  width: 13px;
  height: 13px;
}

a.pager-btn:hover {
  background: #f8fbff;
  color: #1e40af;
  text-decoration: none;
}

.pager-btn.is-disabled {
  color: #cbd5e1;
  cursor: default;
}

.pager-pos {
  padding: 0 10px;
  font-size: 12px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  border-inline: 1px solid #eef2f7;
  line-height: 30px;
}

.reader-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  border-bottom: 1px solid #e2e8f0;
}

.reader-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.reader-title-text {
  min-width: 0;
}

.reader-title-text h1 {
  margin: 0;
  font-size: clamp(17.5px, 1.9vw, 21px);
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink);
}

.reader-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.meta-dot {
  color: #cbd5e1;
}

.reader-mode-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #dfe7f1;
  color: #475569;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

.proto-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 34px;
  padding: 0 18px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  color: #64748b;
}

.proto-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.proto-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
}

.proto-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #475569;
  font-weight: 500;
}

.proto-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0f766e;
  font-weight: 550;
  white-space: nowrap;
  flex: none;
}

.proto-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #14b8a6;
}

.presale-preview {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
}

.doc-preview {
  height: calc(100vh - 304px);
  min-height: 440px;
  max-height: 860px;
  background: #f5f7fb;
}

.proto-preview {
  height: calc(100vh - 338px);
  min-height: 440px;
  max-height: 900px;
}

.presale-text-wrap {
  background: #f5f7fb;
  padding: 20px 20px 26px;
}

.presale-text {
  margin: 0 auto;
  max-width: 860px;
  padding: 32px 44px 38px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 14.5px/1.88 "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: #1e293b;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
}

/* === Admin Internal Presales Views (#presales & #p/:slug/presales) === */
.sales-workspace {
  width: 100%;
  max-width: none;
  margin: 2px auto 0;
}

.sales-banner h2 {
  margin: 6px 0 0;
  font-size: clamp(22px, 2.4vw, 26px);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.sales-banner-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.sales-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  text-decoration: none;
}

.sales-back .glyph {
  width: 14px;
  height: 14px;
}

.sales-back:hover {
  color: #1e40af;
  text-decoration: none;
}

.sales-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

.sales-btn-secondary,
.sales-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.sales-btn-secondary {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--ink);
}

.sales-btn-secondary .glyph {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.sales-btn-secondary:hover {
  border-color: #93c5fd;
  background: #f8fbff;
  color: #1e40af;
  text-decoration: none;
}

.sales-btn-primary {
  border: 1px solid #1d4ed8;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.24);
}

.sales-btn-primary:hover {
  background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%);
  border-color: #1e40af;
}

.sales-btn-primary.is-copied {
  background: #15803d;
  border-color: #15803d;
  box-shadow: 0 1px 2px rgba(21, 128, 61, 0.24);
}

.sales-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  align-items: start;
  gap: 20px;
}

.sales-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 54px;
  padding: 12px 20px;
  background: #fbfcfe;
  border-bottom: 1px solid #e2e8f0;
}

.panel-head-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
}

.count-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.panel-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid #dfe7f1;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.filter-pill small {
  font-size: 11px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.filter-pill:hover {
  border-color: #cbd5e1;
  color: var(--ink);
}

.filter-pill.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
  font-weight: 600;
}

.filter-pill.active small {
  color: #1e40af;
}

.sales-files .file-table th,
.sales-files .file-table td {
  padding-inline: 16px;
}

.sales-files .type-cell {
  width: 126px;
}

.sales-files .size-cell {
  width: 86px;
}

.sales-files .date-cell {
  width: 146px;
}

.sales-files .action-cell {
  width: 96px;
}

.sales-files .file-panel-foot {
  padding-inline: 16px;
}

.sales-props {
  position: sticky;
  top: 110px;
  overflow-wrap: anywhere;
}

.sales-dl {
  margin: 0;
  padding: 6px 20px 14px;
}

.sales-dl > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #eef2f7;
}

.sales-dl > div:last-child {
  border-bottom: 0;
}

.sales-dl dt {
  color: var(--muted);
  font-size: 12.5px;
}

.sales-dl dd {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.55;
}

.muted-val {
  color: #94a3b8;
}

.share-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

.share-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.share-state.is-on {
  color: #15803d;
  background: #dcfce7;
}

.share-state.is-off {
  color: #64748b;
  background: #f1f5f9;
}

.sales-card-body {
  padding: 20px 22px 22px;
}

.sales-timeline {
  padding: 0 0 0 22px;
  margin: 0 0 0 6px;
  list-style: none;
  border-left: 2px solid #dbeafe;
}

.sales-timeline li {
  position: relative;
  padding: 0 0 16px 4px;
}

.sales-timeline li:last-child {
  padding-bottom: 0;
}

.sales-timeline li::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 17px;
  width: 10px;
  height: 10px;
  background: #94a3b8;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #cbd5e1;
  border-radius: 50%;
}

.sales-timeline li.is-latest::before {
  background: #2563eb;
  box-shadow: 0 0 0 3px #dbeafe;
}

.timeline-item-card {
  background: #fbfcfe;
  border: 1px solid #e8eef6;
  border-radius: 10px;
  padding: 14px 16px;
}

.sales-timeline li.is-latest .timeline-item-card {
  background: #ffffff;
  border-color: #d6e4fb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.04);
}

.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.timeline-stage-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.timeline-stage {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
}

.timeline-latest-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 11px;
  font-weight: 600;
}

.timeline-head small {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.timeline-note {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.68;
  color: #334155;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.timeline-next {
  margin-top: 10px;
  padding: 8px 12px;
  border-left: 3px solid #2563eb;
  border-radius: 0 7px 7px 0;
  background: #f4f8ff;
  font-size: 12.5px;
  color: #334155;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-next strong {
  color: #1e40af;
  font-weight: 600;
  white-space: nowrap;
}

/* === Admin Presales Pipeline List (#presales) === */
.pipeline {
  width: 100%;
  border-collapse: collapse;
}

.pipeline thead th {
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 11px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.pipeline tbody th,
.pipeline tbody td {
  padding: 15px 20px;
  border-bottom: 1px solid #eef2f7;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.pipeline tbody th {
  white-space: normal;
  background: transparent;
  font-weight: 400;
  min-width: 220px;
}

.pipeline tbody tr {
  transition: background-color 0.14s ease, box-shadow 0.14s ease;
}

.pipeline tbody tr:last-child > * {
  border-bottom: 0;
}

.pipeline tbody tr:hover {
  background: #f8fbff;
  box-shadow: inset 3px 0 0 #2563eb;
}

.pipeline-title {
  display: inline-block;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
}

.pipeline-title:hover {
  color: #1e40af;
  text-decoration: underline;
}

.pipeline-sub {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.pipeline-stage {
  width: 132px;
  white-space: nowrap;
}

.pipeline-note {
  max-width: 36em;
}

.pipeline-summary {
  font-size: 13.5px;
  line-height: 1.58;
  color: #334155;
  white-space: pre-wrap;
}

.pipeline-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pipeline-next {
  color: #475569;
}

.pipeline-next strong {
  color: #1e40af;
  font-weight: 600;
}

.pipeline-owner {
  width: 148px;
  font-size: 13px;
  color: #334155;
}

.pipeline-count {
  width: 150px;
  white-space: nowrap;
}

.pipeline-count .count-pill {
  margin-right: 6px;
}

/* === Responsive Breakpoints === */
@media (max-width: 960px) {
  .catalog-hero,
  .sales-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 18px 20px 18px 24px;
  }

  .catalog-metrics {
    justify-content: space-between;
  }

  .catalog-metrics > div {
    flex: 1;
    padding: 2px 14px;
  }

  .catalog-metrics > div:first-child {
    padding-left: 0;
  }

  .sales-detail {
    grid-template-columns: 1fr;
  }

  .sales-props {
    position: static;
    order: -1;
  }

  .file-table .size-cell {
    display: none;
  }
}

@media (max-width: 680px) {
  .room-bar-inner {
    min-height: 52px;
    padding: 0 14px;
  }

  .room-brand {
    gap: 8px;
    font-size: 12.5px;
  }

  .room-brand strong {
    font-size: 14px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }

  .brand-mark::after {
    width: 14px;
    height: 14px;
  }

  .room-mode {
    padding: 3px 9px;
    font-size: 11.5px;
  }

  .presale-public {
    padding: 16px 14px 30px;
  }

  .catalog-hero {
    padding: 16px 16px 16px 20px;
    margin-bottom: 14px;
  }

  .catalog-hero h1 {
    font-size: 20px;
    margin-top: 6px;
  }

  .catalog-brief {
    font-size: 12.5px;
  }

  .catalog-metrics {
    padding: 10px 12px;
  }

  .catalog-metrics > div {
    padding: 0 10px;
  }

  .catalog-metrics > div:last-child {
    flex: 1.45;
  }

  .catalog-metrics dd strong {
    font-size: 16px;
  }

  .catalog-metrics .metric-date dd strong {
    font-size: 14px;
  }

  /* Stack filter tabs and search box cleanly on mobile */
  .file-tools {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    min-height: 0;
  }

  .file-tools nav {
    padding: 0 14px;
    gap: 18px;
    border-bottom: 1px solid #eef2f7;
  }

  .file-tools nav a {
    min-height: 44px;
    font-size: 13px;
  }

  .file-search {
    width: auto;
    margin: 10px 14px;
    height: 38px;
  }

  .search-state,
  .file-panel-foot {
    padding: 10px 14px;
  }

  .file-table .type-cell,
  .file-table .size-cell,
  .file-table .date-cell,
  .file-table thead {
    display: none;
  }

  .file-table :is(td, th) {
    padding: 13px 14px;
  }

  .file-table .action-cell {
    width: 78px;
    padding-left: 0;
  }

  .file-entry {
    gap: 11px;
  }

  .file-tile {
    width: 36px;
    height: 36px;
  }

  .file-tile .glyph {
    width: 19px;
    height: 19px;
  }

  .file-caption strong {
    font-size: 14px;
  }

  .file-mobile-meta {
    display: block;
    margin-top: 3px;
  }

  .open-file {
    padding: 4px 6px;
    margin-right: -6px;
    font-size: 12.5px;
  }

  .reader-nav {
    gap: 10px;
  }

  .reader-sep,
  .reader-crumb {
    display: none;
  }

  .reader-head {
    padding: 15px 16px;
  }

  .presale-text-wrap {
    padding: 12px 10px 20px;
  }

  .presale-text {
    padding: 20px 16px 26px;
    border-radius: 8px;
  }

  .room-status-card {
    margin: 28px auto;
    padding: 32px 20px 24px;
  }

  .sales-banner {
    padding: 16px 16px 16px 20px;
  }

  .sales-actions {
    width: 100%;
  }

  .sales-btn-secondary,
  .sales-btn-primary {
    flex: 1;
  }

  .pipeline,
  .pipeline tbody {
    display: block;
  }

  .pipeline thead {
    display: none;
  }

  .pipeline tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
  }

  .pipeline tbody tr:last-child {
    border: 0;
  }

  .pipeline tbody :is(td, th) {
    border: 0;
    padding: 0;
    width: auto;
    min-width: 0;
  }

  .pipeline-note {
    grid-column: 1 / -1;
  }
}

/* === Accessibility & Print Polish === */
@media (prefers-reduced-motion: reduce) {
  .file-tools nav a,
  .file-tools nav a::after,
  .file-search,
  .file-table tbody tr,
  .file-tile,
  .open-file,
  .open-file .glyph,
  .back-btn,
  .pager-btn,
  .sales-btn-secondary,
  .sales-btn-primary,
  .filter-pill,
  .pipeline tbody tr {
    transition: none;
  }
}

@media print {
  .room {
    background: #fff;
  }

  .room-bar {
    position: static;
    box-shadow: none;
    backdrop-filter: none;
  }

  .file-search,
  .file-table .action-cell,
  .reader-nav,
  .proto-bar {
    display: none;
  }

  .catalog-hero,
  .file-panel,
  .reader-card {
    box-shadow: none;
    border-color: #cbd5e1;
  }
}

/* === Presales Stage Workspace V2 (Executive Layout, Gallery, Preview Modals & Public Upgrades) === */
.catalog-hero-cta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.catalog-hero-cta .sales-btn-primary .glyph,
.sales-btn-primary .glyph {
  width: 14px;
  height: 14px;
  color: currentColor;
}

.file-tile-thumb {
  padding: 0;
  overflow: hidden;
  background: #f8fafc;
}

.file-tile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reader-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.presale-image-stage {
  background: #f4f7fb;
  padding: 24px;
  text-align: center;
}

.presale-image-full {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid #dfe7f1;
  background: #fff;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.07);
}

.presale-md-body {
  margin: 0 auto;
  max-width: 880px;
  padding: 34px 44px 42px;
  font: 14.8px/1.86 "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: #1e293b;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
  overflow-wrap: anywhere;
}

.presale-md-body h1 {
  font-size: 22px;
  line-height: 1.38;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.presale-md-body h2 {
  font-size: 17px;
  line-height: 1.4;
  font-weight: 700;
  color: #0f172a;
  margin: 26px 0 12px;
  padding-left: 11px;
  border-left: 3px solid #1d4ed8;
}

.presale-md-body h3 {
  font-size: 15.5px;
  font-weight: 650;
  color: #1e293b;
  margin: 18px 0 8px;
}

.presale-md-body p {
  margin: 0 0 12px;
}

.presale-md-body ul,
.presale-md-body ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.presale-md-body li {
  margin-bottom: 5px;
}

.presale-md-body blockquote {
  margin: 14px 0;
  padding: 11px 16px;
  border-left: 3px solid #2563eb;
  background: #f8fbff;
  color: #334155;
  border-radius: 0 8px 8px 0;
}

.presale-md-body blockquote p:last-child {
  margin-bottom: 0;
}

.presale-md-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 22px;
  font-size: 13.5px;
  border: 1px solid #dbe3ee;
}

.presale-md-body th,
.presale-md-body td {
  border: 1px solid #e2e8f0;
  padding: 9px 13px;
  text-align: left;
  vertical-align: top;
}

.presale-md-body thead th {
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
}

.presale-md-body code {
  font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  background: #f1f5f9;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 4px;
}

.presale-md-body .md-code-lang {
  display: inline-block;
  margin: 14px 0 -8px;
  padding: 2px 9px;
  border-radius: 6px 6px 0 0;
  background: #1e293b;
  color: #93c5fd;
  font-size: 11.5px;
  font-weight: 600;
}

.presale-md-body pre.md-code {
  margin: 10px 0 18px;
  padding: 14px 16px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  overflow-x: auto;
  font: 12.5px/1.62 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.presale-md-body pre.md-code code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.presale-md-body figure.md-figure {
  margin: 16px 0 22px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  text-align: center;
}

.presale-md-body figure.md-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.presale-md-body figure.md-figure figcaption {
  margin-top: 8px;
  font-size: 12.5px;
  color: #64748b;
}

.presale-md-body hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 22px 0;
}

/* Presales Stage Hero */
.sales-stage-hero {
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  padding: 22px 26px 22px 30px;
}

.sales-hero-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.hero-sep {
  color: #cbd5e1;
  font-size: 12px;
}

.hero-code-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #dbe3ee;
  color: #334155;
  font: 600 11.5px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.sales-hero-summary {
  margin: 9px 0 0;
  font-size: 13.5px;
  line-height: 1.68;
  color: #475569;
  max-width: 1040px;
}

.sales-hero-tags {
  margin-top: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f4f8ff;
  border: 1px solid #dbeafe;
  color: #1e40af;
  font-size: 11.5px;
  font-weight: 550;
}

.sales-hero-actions {
  padding-top: 14px;
  border-top: 1px solid #edf2f8;
  justify-content: flex-start;
}

.sales-btn-secondary.is-copied {
  border-color: #15803d;
  background: #f0fdf4;
  color: #15803d;
}

.sales-btn-compact {
  height: 34px;
  padding: 0 12px;
  font-size: 12.5px;
}

/* 4-Card KPI Strip */
.presale-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.presale-kpi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid #dfe7f1;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 4px 14px rgba(15, 23, 42, 0.02);
  overflow: hidden;
}

.presale-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #2563eb;
}

.kpi-tone-blue::before { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.kpi-tone-teal::before { background: linear-gradient(90deg, #0f766e, #2dd4bf); }
.kpi-tone-amber::before { background: linear-gradient(90deg, #d97706, #fbbf24); }
.kpi-tone-emerald::before { background: linear-gradient(90deg, #15803d, #4ade80); }
.kpi-tone-slate::before { background: linear-gradient(90deg, #475569, #94a3b8); }

.presale-kpi-label {
  font-size: 12px;
  font-weight: 550;
  color: #64748b;
}

.presale-kpi-val {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.presale-kpi-val.is-compact {
  font-size: 16.5px;
  line-height: 1.38;
}

.presale-kpi-sub {
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

/* Prototype Quick-Launch Cards */
.proto-launch-band {
  margin-bottom: 18px;
}

.proto-launch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 16px 20px 18px;
  background: #fbfcfe;
}

.proto-launch-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #dfe7f1;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.proto-launch-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
  text-decoration: none;
}

.proto-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.proto-card-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font: 700 11.5px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.proto-card-go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 550;
  color: #1d4ed8;
}

.proto-card-go .glyph {
  width: 13px;
  height: 13px;
}

.proto-card-title {
  font-size: 13.8px;
  line-height: 1.42;
  font-weight: 650;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.proto-card-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Full Presales Materials Hub */
.presale-hub {
  margin-bottom: 18px;
}

.presale-hub-head {
  gap: 12px 18px;
}

.presale-hub-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.presale-hub-search {
  width: 240px;
  height: 34px;
  padding-left: 10px;
  gap: 6px;
}

.presale-hub-search .search-ico {
  display: inline-grid;
  place-items: center;
  color: #64748b;
  flex: none;
}

.presale-hub-search .search-ico .glyph {
  width: 15px;
  height: 15px;
}

.sales-hub-table tbody tr:hover {
  background: #f8fbff;
  box-shadow: inset 3px 0 0 #2563eb;
}

/* Inside internal hub table, use scoped button/links instead of full-row overlay so dual Preview + Download buttons both work cleanly */
.sales-hub-table a.file-entry-inline::after {
  content: none;
}

.file-entry-btn {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.file-entry-btn:hover strong,
.file-entry-inline:hover strong {
  color: #1e40af;
}

.sales-files .action-cell.action-cell-dual {
  width: 162px;
  text-align: right;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.row-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid #d8e1ec;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.row-act-btn .glyph {
  width: 13px;
  height: 13px;
}

.row-act-btn:hover {
  border-color: #93c5fd;
  background: #f8fbff;
  color: #1e40af;
  text-decoration: none;
}

.row-act-primary {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
}

.row-act-primary:hover {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

/* Architecture & Flow Diagram Gallery */
.diagram-shelf {
  border-top: 1px solid #e2e8f0;
  background: #fafcff;
  padding: 18px 20px 20px;
}

.diagram-shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.diagram-shelf-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: #0f172a;
}

.diagram-shelf-hint {
  font-size: 12px;
  color: #64748b;
}

.diagram-gallery-section {
  padding: 18px 20px 20px;
  background: #fafcff;
}

.diagram-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

.diagram-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #dfe7f1;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.diagram-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.diagram-thumb-btn {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 8px;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  background: #f8fafc;
  cursor: pointer;
  overflow: hidden;
}

.diagram-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.diagram-card:hover .diagram-thumb-btn img {
  transform: scale(1.02);
}

.diagram-zoom-pill {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 11.5px;
  font-weight: 550;
  backdrop-filter: blur(4px);
}

.diagram-zoom-pill .glyph {
  width: 13px;
  height: 13px;
}

.diagram-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
}

.diagram-card-info {
  min-width: 0;
}

.diagram-card-info strong {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagram-card-info small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Flush Equal-Height 2-Column Bottom Band */
.sales-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.sales-bottom-grid > .sales-card {
  display: flex;
  flex-direction: column;
}

.sales-profile-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.quote-breakdown {
  margin: 6px 20px 18px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f8fbff;
  border: 1px solid #dbeafe;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quote-breakdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}

.quote-breakdown-head strong {
  color: #0f172a;
}

.quote-breakdown-head span {
  color: #1e40af;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.quote-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quote-bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #475569;
}

.quote-bar-meta strong {
  color: #0f172a;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.quote-bar-track {
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.quote-bar-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.quote-bar-track .bar-hw { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.quote-bar-track .bar-sw { background: linear-gradient(90deg, #0f766e, #14b8a6); }
.quote-bar-track .bar-sv { background: linear-gradient(90deg, #d97706, #f59e0b); }

/* Pipeline Table Enhancements (#presales & #projects badge) */
.pipeline-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.presale-phase-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.pipeline-count-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pipeline-pills,
.pipeline-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.pipeline-action-link {
  font-size: 12.5px;
  font-weight: 600;
  color: #1e40af;
  text-decoration: none;
}

.pipeline-action-link:hover {
  text-decoration: underline;
}

.pipeline-proto-link {
  font-size: 12px;
  font-weight: 550;
  color: #0f766e;
  text-decoration: none;
}

.pipeline-proto-link:hover {
  text-decoration: underline;
}

/* In-Page Document / PDF Preview Modal */
.presale-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.presale-modal-panel {
  width: min(1240px, 94vw);
  height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.presale-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex: none;
}

.presale-modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.presale-modal-title-text {
  min-width: 0;
}

.presale-modal-title-text h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presale-modal-meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
}

.presale-modal-fn {
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presale-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.presale-modal-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  cursor: pointer;
}

.presale-modal-close:hover {
  border-color: #94a3b8;
  color: #0f172a;
  background: #f1f5f9;
}

.presale-modal-body {
  flex: 1;
  min-height: 0;
  background: #eef2f7;
}

.presale-modal-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

/* High-Res Architecture / Diagram Lightbox */
.presale-lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  padding: 18px 24px 24px;
}

.presale-lightbox-shell {
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #f8fafc;
  flex: none;
}

.lightbox-title-wrap {
  min-width: 0;
}

.lightbox-title-wrap h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: #fff;
}

.lightbox-meta {
  display: inline-block;
  margin-top: 3px;
  font-size: 12.5px;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.lightbox-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-size: 12.5px;
  font-weight: 550;
  text-decoration: none;
}

.lightbox-btn .glyph {
  width: 14px;
  height: 14px;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

.lightbox-btn-primary {
  background: #2563eb;
  border-color: #3b82f6;
}

.lightbox-btn-primary:hover {
  background: #1d4ed8;
}

.lightbox-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.lightbox-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.lightbox-img-frame {
  flex: 0 1 auto;
  max-width: calc(100% - 112px);
  max-height: calc(100vh - 110px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.45);
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 134px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.lightbox-nav {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}

.lightbox-nav:hover {
  background: #2563eb;
  border-color: #60a5fa;
}

@media (max-width: 860px) {
  .presale-kpi-grid,
  .proto-launch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .diagram-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .presale-kpi-grid,
  .proto-launch-grid,
  .diagram-gallery {
    grid-template-columns: 1fr;
  }

  .presale-hub-tools,
  .presale-hub-search {
    width: 100%;
  }

  .sales-files .action-cell.action-cell-dual {
    width: auto;
  }

  .presale-md-body {
    padding: 20px 16px 26px;
  }

  .presale-modal-backdrop {
    padding: 8px;
  }

  .presale-modal-panel {
    width: 100%;
    height: 92vh;
  }

  .presale-modal-head {
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .lightbox-nav {
    display: none;
  }
}

/* === Presales Fast List Board, Checkboxes & One-Click Share Copy === */
.sales-board-hero {
  padding: 18px 24px 18px 28px;
  gap: 20px;
}

.sales-board-actions {
  gap: 8px;
}

.presale-kpi-compact {
  margin-bottom: 16px;
}

.presale-kpi-compact .presale-kpi-card {
  padding: 13px 16px;
}

.presale-kpi-compact .presale-kpi-val {
  font-size: 20px;
}

.proto-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 2px;
}

.proto-quick-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #d1fae5;
  background: #f0fdf4;
  color: #0f766e;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.proto-quick-chip .glyph {
  width: 12px;
  height: 12px;
  flex: none;
}

.proto-quick-chip:hover {
  background: #dcfce7;
  border-color: #6ee7b7;
  color: #065f46;
  text-decoration: none;
}

.presale-hub-copy-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.presale-filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.presale-fast-search {
  width: min(380px, 100%);
  height: 36px;
  padding-left: 11px;
  gap: 7px;
  flex: 1 1 260px;
  max-width: 420px;
}

.presale-fast-search .search-ico {
  display: inline-grid;
  place-items: center;
  color: #64748b;
  flex: none;
}

.presale-fast-search .search-ico .glyph {
  width: 15px;
  height: 15px;
}

.batch-copy-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 20px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  font-size: 12.5px;
  color: #1e3a8a;
}

.batch-copy-bar[hidden] {
  display: none;
}

.batch-copy-info strong {
  color: #1d4ed8;
  font-weight: 700;
}

.batch-copy-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sales-files .check-cell {
  width: 44px;
  padding-right: 4px;
  text-align: center;
}

.row-check {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  cursor: pointer;
  vertical-align: middle;
}

.sales-hub-table tbody tr.is-selected {
  background: #f4f8ff;
}

.sales-files .action-cell.action-cell-triple {
  width: 244px;
  text-align: right;
}

.row-act-copy {
  border-color: #cbd5e1;
  color: #334155;
}

.row-act-btn.is-copied,
.lightbox-btn.is-copied {
  border-color: #15803d !important;
  background: #f0fdf4 !important;
  color: #15803d !important;
}

/* Shareable Copy Preview Modal */
.share-copy-panel {
  width: min(760px, 94vw);
  height: auto;
  max-height: 88vh;
}

.share-copy-body {
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

.share-copy-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
}

.share-copy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: #334155;
  cursor: pointer;
  user-select: none;
}

.share-copy-toggle input {
  width: 15px;
  height: 15px;
  accent-color: #2563eb;
}

.share-copy-textarea {
  width: 100%;
  min-height: 300px;
  max-height: 52vh;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font: 13px/1.68 "PingFang SC", "Microsoft YaHei", ui-monospace, SFMono-Regular, Consolas, monospace;
  resize: vertical;
  outline: none;
}

.share-copy-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.share-copy-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #64748b;
}

@media (max-width: 680px) {
  .sales-files .check-cell {
    display: none;
  }

  .sales-files .action-cell.action-cell-triple {
    width: auto;
  }

  .presale-filter-toolbar {
    padding: 10px 14px;
  }

  .presale-fast-search {
    max-width: none;
  }

  .proto-chip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* === Presales Command Bar, Grouped List Dividers, View Toggle & Presales Guides/Messages Polish === */
.sales-command-bar {
  padding: 15px 22px 15px 26px;
  margin-bottom: 14px;
  gap: 16px 22px;
  align-items: center;
}

.command-bar-left {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
}

.command-bar-desc {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presale-kpi-compact {
  margin-bottom: 14px;
  gap: 12px;
}

.presale-kpi-compact .presale-kpi-card {
  padding: 12px 15px;
  gap: 4px;
}

.presale-kpi-compact .presale-kpi-val {
  font-size: 19px;
}

.presale-kpi-compact .presale-kpi-sub {
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* View Mode Segmented Switcher */
.view-seg {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #dfe7f1;
  margin-left: 6px;
}

.view-seg-btn {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 550;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.view-seg-btn:hover {
  color: #0f172a;
}

.view-seg-btn.active {
  background: #fff;
  color: #1e40af;
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* Compact Scannable List Rows & Grouped Section Dividers */
.sales-hub-table tbody th,
.sales-hub-table tbody td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.file-tile-wide {
  width: 52px;
  height: 34px;
  border-radius: 7px;
}

.sales-hub-table tr.group-divider-row {
  background: #f8fafd;
}

.sales-hub-table tr.group-divider-row:hover {
  background: #f8fafd;
  box-shadow: none;
}

.sales-hub-table tr.group-divider-row > td {
  padding-top: 8px;
  padding-bottom: 8px;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.sales-hub-table tbody tr.group-divider-row:first-child > td {
  border-top: 0;
}

.group-divider-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.group-divider-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone, #2563eb);
  flex: none;
}

.group-divider-title strong {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.group-divider-count {
  padding: 1px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.group-divider-desc {
  font-size: 12px;
  color: #64748b;
}

.group-divider-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.group-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.group-copy-btn .glyph {
  width: 12px;
  height: 12px;
}

.group-copy-btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e40af;
}

.group-copy-btn.is-copied {
  border-color: #15803d;
  background: #f0fdf4;
  color: #15803d;
}

.foot-link-btn {
  border: 0;
  background: transparent;
  color: #1e40af;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.foot-link-btn:hover {
  text-decoration: underline;
}

/* Presales Guides Executive Cards & Flush 2-Col Messages */
.presale-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 16px;
}

.presale-guide-card {
  background: #fff;
  border: 1px solid #dfe7f1;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 6px 18px rgba(15, 23, 42, 0.025);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.presale-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-bottom: 1px solid #e2e8f0;
}

.presale-guide-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 700;
  color: #0f172a;
}

.presale-guide-body {
  padding: 15px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.presale-guide-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12.5px;
  color: #334155;
}

.presale-guide-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.presale-guide-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.62;
  color: #1e293b;
}

.guide-step-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font: 700 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.presale-guide-expected {
  margin-top: auto;
  padding: 9px 12px;
  border-left: 3px solid #0f766e;
  border-radius: 0 8px 8px 0;
  background: #f0fdfa;
  font-size: 12.5px;
  line-height: 1.55;
  color: #134e4a;
}

.presale-msg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: stretch;
}

.presale-msg-grid > .group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.presale-msg-grid > .group > .detail {
  flex: 1;
}

@media (max-width: 900px) {
  .sales-command-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .command-bar-desc {
    white-space: normal;
  }

  .presale-msg-grid {
    grid-template-columns: 1fr;
  }

  .presale-guide-grid {
    grid-template-columns: 1fr;
  }

  .group-divider-desc {
    display: none;
  }
}

/* === Minimal Decluttered Presales List & AI Sales Pitch Modal === */
.presale-hub-clean {
  margin-top: 2px;
}

.sales-btn-ai {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid #4f46e5;
  background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.28);
  transition: filter 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.sales-btn-ai .glyph {
  width: 14px;
  height: 14px;
  color: currentColor;
}

.sales-btn-ai:hover {
  filter: brightness(1.06);
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.34);
}

.sales-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-size: 12.5px;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.sales-btn-ghost .glyph {
  width: 13px;
  height: 13px;
}

.sales-btn-ghost:hover {
  background: #f1f5f9;
  color: #1e40af;
  text-decoration: none;
}

.row-act-ai {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
}

.row-act-ai:hover {
  border-color: #4f46e5;
  background: #4f46e5;
  color: #fff;
}

.ai-pitch-panel {
  width: min(760px, 94vw);
}

.ai-pitch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-pitch-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  min-width: 52px;
}

.ai-pitch-focus-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-pitch-focus-input {
  flex: 1;
  height: 34px;
  padding: 0 11px;
  font-size: 12.5px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.ai-pitch-focus-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  outline: none;
}

.ai-pitch-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  font-size: 12.5px;
  font-weight: 550;
}

.ai-pitch-status[hidden],
.ai-pitch-error[hidden] {
  display: none;
}

.ai-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #a5b4fc;
  border-top-color: #4f46e5;
  animation: pb-spin 0.75s linear infinite;
  flex: none;
}

@keyframes pb-spin {
  to { transform: rotate(360deg); }
}

.ai-pitch-error {
  margin: 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 12.5px;
}

.ai-pitch-textarea {
  min-height: 270px;
}

.ai-pitch-meta {
  font-size: 12px;
  color: #64748b;
}


/* ============================================================================
 * Multi-Format Self-Hosted Online File Preview (Word / Excel / PPT / MD / HTML)
 * ============================================================================ */
.presale-modal-panel-wide {
  width: min(1440px, 95vw);
  height: min(92vh, 940px);
}

.presale-modal-body-rich {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #f4f6fa;
}

.pb-public-preview {
  display: flex;
  flex-direction: column;
  height: clamp(540px, calc(100vh - 280px), 860px);
  background: #f4f6fa;
  overflow: hidden;
}

.pv-standalone-body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: #f4f6fa;
}

.pv-standalone-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.pv-standalone-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 22px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.pv-standalone-head h1 {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.35;
  font-weight: 700;
  color: #0f172a;
}

.pv-standalone-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pv-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f4f6fa;
}

.pv-toolbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: #fafbfd;
  border-bottom: 1px solid #e2e8f0;
}

.pv-toolbar-left,
.pv-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.pv-toolbar-meta {
  font-size: 12px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.pv-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pv-badge-word { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.pv-badge-excel { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.pv-badge-ppt { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.pv-badge-md { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.pv-badge-html { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }
.pv-badge-text { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.pv-badge-img { background: #faf5ff; color: #7e22ce; border-color: #e9d5ff; }

.pv-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.pv-tool-btn:hover:not(:disabled) {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e40af;
}

.pv-tool-btn.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 650;
}

.pv-tool-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pv-zoom-val {
  min-width: 44px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  font-variant-numeric: tabular-nums;
}

.pv-seg {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 7px;
  background: #eef2f6;
  border: 1px solid #dbe3ee;
}

.pv-seg[hidden] {
  display: none;
}

.pv-seg-btn {
  border: 0;
  background: transparent;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 550;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.pv-seg-btn:hover {
  color: #0f172a;
}

.pv-seg-btn.active {
  background: #fff;
  color: #1e40af;
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* Loading & Error States */
.pv-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 24px;
  color: #475569;
  font-size: 13.5px;
}

.pv-loading-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.pv-progress-track {
  width: min(320px, 80vw);
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.pv-progress-track[hidden] {
  display: none;
}

.pv-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb 0%, #4f46e5 100%);
  transition: width 0.12s linear;
}

.pv-error-card {
  margin: auto;
  max-width: 440px;
  padding: 28px 26px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  text-align: center;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.pv-error-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #0f172a;
}

.pv-error-desc {
  margin: 8px 0 18px;
  font-size: 13px;
  line-height: 1.65;
  color: #64748b;
}

.pv-empty {
  padding: 48px 20px;
  text-align: center;
  color: #64748b;
  font-size: 13.5px;
}

/* === 1. Word (.docx) Viewer === */
.pv-docx-viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 36px;
  background: #e9eef5;
}

.pv-docx-scale {
  display: flex;
  justify-content: center;
  min-width: min-content;
}

.pv-docx-host .pb-docx-wrapper {
  background: transparent !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.pv-docx-host section.pb-docx {
  background: #fff !important;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(15, 23, 42, 0.06) !important;
  margin-bottom: 0 !important;
}

/* === 2. Excel (.xlsx / .xls / .csv) Multi-Sheet Viewer === */
.pv-sheet-search {
  width: 196px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 12px;
  color: #0f172a;
}

.pv-sheet-search:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.pv-check-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.pv-check-label input {
  accent-color: #2563eb;
}

.pv-sheet-tabs {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #f1f5f9;
  border-bottom: 1px solid #dbe3ee;
  overflow-x: auto;
}

.pv-sheet-tab {
  flex: none;
  border: 1px solid #d5dfeb;
  background: #fff;
  color: #475569;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.pv-sheet-tab:hover {
  border-color: #93c5fd;
  color: #1e40af;
}

.pv-sheet-tab.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
  font-weight: 650;
}

.pv-sheet-viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fff;
}

.pv-xl-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font: 12.5px/1.55 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #1e293b;
}

.pv-xl-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f1f5f9;
  color: #475569;
  font-weight: 650;
  text-align: center;
  padding: 6px 10px;
  border-right: 1px solid #dbe3ee;
  border-bottom: 1px solid #cbd5e1;
  font-size: 11.5px;
  user-select: none;
}

.pv-xl-corner {
  left: 0;
  z-index: 4 !important;
  min-width: 40px;
}

.pv-xl-rowhead {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 40px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 11.5px;
  text-align: center;
  padding: 6px 8px;
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #e2e8f0;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.pv-xl-cell {
  padding: 6px 11px;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
  max-width: 360px;
  min-width: 68px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #fff;
}

.pv-xl-table tbody tr:hover td {
  background: #f8fbff;
}

.pv-xl-first-row td {
  background: #f8fafd;
  font-weight: 650;
  color: #0f172a;
}

.pv-xl-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pv-mark {
  background: #fef08a;
  color: #0f172a;
  padding: 0 2px;
  border-radius: 3px;
}

.pv-xl-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 12.5px;
  color: #475569;
}

/* === 3. Markdown + Mermaid + TOC Viewer === */
.pv-md-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  overflow: hidden;
}

.pv-md-layout.no-toc {
  grid-template-columns: minmax(0, 1fr);
}

.pv-md-toc {
  border-right: 1px solid #e2e8f0;
  background: #fafbfd;
  overflow-y: auto;
  padding: 14px 12px 24px;
}

.pv-md-toc[hidden] {
  display: none;
}

.pv-md-toc-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
  padding: 0 8px 8px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 8px;
}

.pv-md-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pv-toc-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #334155;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pv-toc-btn:hover {
  background: #eff6ff;
  color: #1e40af;
}

.pv-toc-lvl-1 .pv-toc-btn { font-weight: 700; color: #0f172a; }
.pv-toc-lvl-2 .pv-toc-btn { padding-left: 14px; font-weight: 550; }
.pv-toc-lvl-3 .pv-toc-btn { padding-left: 24px; font-size: 12px; color: #64748b; }

.pv-md-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 36px;
  background: #f4f6fa;
}

.pv-md-scroll[hidden] {
  display: none;
}

.pv-md-paper {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 42px 44px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
}

.pv-md-article {
  font: 14.8px/1.82 "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: #1e293b;
  overflow-wrap: anywhere;
}

.pv-md-article h1 {
  font-size: 21px;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
}

.pv-md-article h2 {
  font-size: 17px;
  margin: 26px 0 11px;
  padding-left: 10px;
  border-left: 3px solid #2563eb;
  color: #0f172a;
}

.pv-md-article h3 {
  font-size: 15px;
  margin: 18px 0 8px;
  color: #1e293b;
}

.pv-md-article p {
  margin: 0 0 12px;
}

.pv-md-article ul,
.pv-md-article ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.pv-md-article li {
  margin-bottom: 5px;
}

.pv-md-article blockquote {
  margin: 14px 0 18px;
  padding: 11px 16px;
  border-left: 3px solid #2563eb;
  background: #f8fbff;
  color: #334155;
  border-radius: 0 8px 8px 0;
}

.pv-md-article blockquote p:last-child {
  margin-bottom: 0;
}

.pv-md-article hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 22px 0;
}

.pv-md-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 20px;
  font-size: 13px;
  border: 1px solid #dbe3ee;
}

.pv-md-article th,
.pv-md-article td {
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.pv-md-article thead th {
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
}

.pv-md-article code {
  font: 12.5px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  background: #f1f5f9;
  color: #0f172a;
  padding: 2px 5px;
  border-radius: 4px;
}

.pv-md-article pre {
  margin: 14px 0 18px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  overflow-x: auto;
  font: 12.5px/1.62 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.pv-md-article pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.pv-md-figure {
  margin: 16px 0 22px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  text-align: center;
}

.pv-md-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.pv-md-figure figcaption {
  margin-top: 8px;
  font-size: 12.5px;
  color: #64748b;
}

.pv-mermaid-card {
  margin: 16px 0 22px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.pv-mermaid-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  background: #f8fafd;
  border-bottom: 1px solid #e2e8f0;
}

.pv-mermaid-title {
  font-size: 12px;
  font-weight: 650;
  color: #334155;
}

.pv-mini-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  padding: 2px 9px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
}

.pv-mini-btn:hover {
  border-color: #93c5fd;
  color: #1e40af;
}

.pv-mermaid-svg {
  padding: 18px 16px;
  overflow-x: auto;
  display: flex;
  justify-content: center;
  background: #fff;
}

.pv-mermaid-svg[hidden],
.pv-mermaid-src[hidden] {
  display: none;
}

.pv-mermaid-svg svg {
  max-width: 100%;
  height: auto;
}

.pv-mermaid-src {
  margin: 0 !important;
  border-radius: 0 !important;
}

/* === 4. HTML Sandbox Viewer & Code Source View === */
.pv-html-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: auto;
  background: #e9eef5;
  padding: 0;
}

.pv-html-stage[hidden] {
  display: none;
}

.pv-html-stage.is-tablet,
.pv-html-stage.is-mobile {
  padding: 18px;
}

.pv-html-frame {
  border: 0;
  background: #fff;
  width: 100%;
  height: 100%;
  transition: width 0.18s ease;
}

.pv-html-stage.is-tablet .pv-html-frame {
  width: 768px;
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14);
}

.pv-html-stage.is-mobile .pv-html-frame {
  width: 390px;
  max-width: 100%;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.16);
}

.pv-code-view {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 18px 22px;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  font: 12.5px/1.68 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pv-code-view[hidden] {
  display: none;
}

/* === 5. PowerPoint (.pptx) Slide Viewer === */
.pv-ppt-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pv-ppt-nav[hidden] {
  display: none;
}

.pv-ppt-viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px;
  background: #e9eef5;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pv-ppt-mount {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pv-ppt-mount .pptx-preview-wrapper-next,
.pv-ppt-mount .pptx-preview-wrapper-pagination {
  display: none !important;
}

.pv-ppt-fallback-deck {
  width: min(880px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pv-ppt-fallback-slide {
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  padding: 20px 26px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.pv-ppt-fallback-num {
  font-size: 11.5px;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 10px;
}

.pv-ppt-fallback-body h4 {
  margin: 0 0 10px;
  font-size: 16px;
  color: #0f172a;
}

.pv-ppt-fallback-body p {
  margin: 0 0 6px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #334155;
}

.pv-muted {
  color: #94a3b8 !important;
}

/* === 6. Image Viewer === */
.pv-image-viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px;
  background: #e9eef5;
  display: grid;
  place-items: center;
}

.pv-image-el {
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.12);
}

.pv-image-el.is-fit {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@media (max-width: 820px) {
  .pv-md-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .pv-md-toc {
    display: none;
  }

  .pv-md-paper {
    padding: 20px 18px 28px;
  }

  .pv-sheet-search {
    width: 140px;
  }
}
