/* ==========================================================================
   IRCC SHAREHOLDING ANALYSIS — CANONICAL
   One component definition per section. No historical patch layers.
   Target profiles: 1920×1080, 1710×1107, 1280×720, 384×832.
   ========================================================================== */

/* 01 — TOKENS */
:root {
  --sha-purple: #6c4cf5;
  --sha-purple-strong: #5f43df;
  --sha-purple-soft: #f1edff;
  --sha-purple-surface: #faf8ff;
  --sha-ink: #292d3f;
  --sha-text: #555b6d;
  --sha-muted: #7d8496;
  --sha-muted-2: #969bad;
  --sha-border: #e3e2eb;
  --sha-border-strong: #d9d6e6;
  --sha-surface: #ffffff;
  --sha-surface-soft: #fafafd;
  --sha-success: #10B981;
  --sha-success-soft: #eaf8f2;
  --sha-danger: #F43F5E;
  --sha-danger-soft: #fff0f3;
  --sha-warning: #F59E0B;
  --sha-warning-soft: #fff7e8;

  /* Shareholding history chart palette — consumed by shareholding-analysis.js */
  --sha-chart-promoter: var(--sha-purple-strong);
  --sha-chart-mutual-funds: var(--sha-warning);
  --sha-chart-fpi: var(--sha-success);
  --sha-chart-public: var(--sha-danger);
  --sha-chart-aif: #2563eb;

  --sha-font-xs: 10px;
  --sha-font-sm: 11px;
  --sha-font-md: 12px;
  --sha-font-lg: 14px;
  --sha-font-xl: 18px;
  --sha-font-2xl: 30px;

  /* Overlay typography — shared modal / drawer hierarchy */
  --sha-overlay-title-size: 20px;
  --sha-overlay-section-title-size: 14px;
  --sha-overlay-body-size: 13px;
  --sha-overlay-control-size: 12px;
  --sha-overlay-subtitle-size: 12px;
  --sha-overlay-meta-size: 11px;
  --sha-overlay-helper-size: 11px;
  --sha-overlay-label-size: 10px;
  --sha-overlay-stat-size: 16px;

  --sha-overlay-title-weight: 800;
  --sha-overlay-section-title-weight: 800;
  --sha-overlay-body-weight: 600;
  --sha-overlay-label-weight: 700;
  --sha-overlay-meta-weight: 600;
  --sha-overlay-helper-weight: 500;
  --sha-overlay-button-weight: 700;

  --sha-overlay-line-tight: 1.15;
  --sha-overlay-line-body: 1.4;
  --sha-overlay-line-helper: 1.45;

  --sha-radius-sm: 9px;
  --sha-radius-md: 12px;
  --sha-radius-lg: 16px;
  --sha-radius-xl: 20px;

  --sha-shadow-sm: 0 2px 8px rgba(43, 39, 72, .05);
  --sha-shadow-md: 0 12px 34px rgba(43, 39, 72, .10);
  --sha-shadow-lg: 0 24px 70px rgba(39, 36, 66, .20);

  --sha-space-1: 4px;
  --sha-space-2: 8px;
  --sha-space-3: 12px;
  --sha-space-4: 16px;
  --sha-space-5: 20px;

  /* Market range selector — replaces the old Month / Week mode switch. */
  --sha-range-bg: var(--sha-purple-surface);
  --sha-range-border: var(--sha-border);
  --sha-range-active-bg: var(--sha-surface);
  --sha-range-active-text: var(--sha-purple-strong);
  --sha-range-text: var(--sha-muted);
  --sha-range-height: 30px;
  --sha-range-min-w: 34px;
  --sha-range-gap: 2px;
  --sha-range-pad-x: 8px;
  --sha-range-radius: 9px;
  --sha-range-font-size: var(--sha-font-xs);
  --sha-range-font-weight: 800;

  /* Ownership history detail modal — used by Pattern + External tables */
  --sha-history-row-hover-bg: var(--sha-purple-surface);
  --sha-history-modal-width: 860px;
  --sha-history-modal-height: 680px;
  --sha-history-modal-max-h: calc(100vh - 28px);
  --sha-history-modal-chart-h: 164px;
  --sha-history-modal-chart-min-w: 680px;
  --sha-history-modal-trend-h: 224px;
  --sha-history-modal-point-gap: 86px;
  --sha-history-modal-pad: 14px;
  --sha-history-modal-gap: 10px;
  --sha-history-modal-radius: var(--sha-radius-xl);
  --sha-history-modal-section-radius: var(--sha-radius-md);
  --sha-history-modal-shadow: var(--sha-shadow-lg);
  --sha-history-modal-border: var(--sha-border);
  --sha-history-modal-grid: var(--sha-border);
  --sha-history-modal-line: var(--sha-purple);
  --sha-history-modal-area: var(--sha-purple-soft);
  --sha-history-modal-point-fill: var(--sha-surface);
  --sha-history-modal-point-stroke: var(--sha-purple);
  --sha-history-modal-summary-bg: var(--sha-purple-surface);
  --sha-history-modal-summary-border: var(--sha-border);
  --sha-history-modal-table-head-bg: var(--sha-surface-soft);
  --sha-history-modal-latest-bg: var(--sha-purple-surface);
  --sha-history-modal-pill-bg: var(--sha-purple-soft);
  --sha-history-modal-pill-border: var(--sha-border);
  --sha-history-modal-icon-size: 32px;
  --sha-history-modal-icon-glyph-size: 15px;
  --sha-history-modal-section-icon-size: 30px;
  --sha-history-modal-meta-gap: 8px;
  --sha-history-modal-summary-gap: 8px;
  --sha-history-modal-stat-pad-y: 9px;
  --sha-history-modal-stat-pad-x: 10px;
  --sha-history-modal-chart-pad-x: 8px;
  --sha-history-modal-chart-pad-y: 6px;
  --sha-history-modal-table-row-h: 34px;
  --sha-history-modal-x-label-size: var(--sha-font-sm);
  --sha-history-modal-member-name-size: var(--sha-font-sm);
  --sha-history-modal-member-note-size: var(--sha-font-xs);
  --sha-history-modal-action-icon-size: 14px;
  --sha-history-modal-member-note-pad-y: 8px;
  --sha-history-modal-member-note-pad-x: 10px;

  /* History modal typography — same semantic overlay scale used across IRCC. */
  --sha-history-modal-title-size: var(--sha-overlay-title-size);
  --sha-history-modal-section-title-size: var(--sha-overlay-section-title-size);
  --sha-history-modal-body-size: var(--sha-overlay-body-size);
  --sha-history-modal-meta-size: var(--sha-overlay-meta-size);
  --sha-history-modal-label-size: var(--sha-overlay-label-size);
  --sha-history-modal-stat-size: var(--sha-overlay-stat-size);
  --sha-history-modal-title-weight: var(--sha-overlay-title-weight);
  --sha-history-modal-section-title-weight: var(--sha-overlay-section-title-weight);
  --sha-history-modal-body-weight: var(--sha-overlay-body-weight);
  --sha-history-modal-label-weight: var(--sha-overlay-label-weight);
  --sha-history-modal-meta-weight: var(--sha-overlay-meta-weight);
  --sha-history-modal-helper-weight: var(--sha-overlay-helper-weight);
  --sha-history-modal-stat-weight: var(--sha-overlay-title-weight);
  --sha-history-modal-close-size: 36px;
  --sha-history-modal-close-icon-size: 16px;
  --sha-history-modal-line-width: 2px;
  --sha-history-modal-point-width: 2px;
  --sha-history-modal-latest-point-size: 5px;
  --sha-history-modal-transition: 160ms;

  /* Email-PDF composer */
  --sha-email-modal-width: 560px;
  --sha-email-control-h: 42px;
  --sha-email-action-h: 40px;
  --sha-email-icon-box: 34px;
  --sha-email-icon-glyph: 15px;
}

/* 02 — BASE */
.sha-page {
  display: block;
  color: var(--sha-ink);
}
.sha-page *, .sha-page *::before, .sha-page *::after { box-sizing: border-box; }
.sha-page button, .sha-page input, .sha-page select { font: inherit; }
.sha-page button { -webkit-tap-highlight-color: transparent; }
.sha-page .hidden { display: none !important; }
.sha-page svg { display: block; }

.sha-spinner {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 2px solid #e2ddfa;
  border-top-color: var(--sha-purple);
  border-radius: 50%;
  animation: sha-spin .7s linear infinite;
}
@keyframes sha-spin { to { transform: rotate(360deg); } }

.sha-loading,
.sha-empty {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sha-space-2);
  padding: 30px;
  border: 1px dashed var(--sha-border-strong);
  border-radius: var(--sha-radius-lg);
  background: var(--sha-surface);
  color: var(--sha-muted);
  text-align: center;
}
.sha-loading { font-size: var(--sha-font-md); font-weight: 600; }
.sha-empty-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--sha-purple-soft);
  color: var(--sha-purple);
}
.sha-empty-icon svg { width: 22px; height: 22px; }
.sha-empty strong { margin-top: 4px; font-size: 16px; }
.sha-empty p { max-width: 480px; margin: 0 0 8px; font-size: var(--sha-font-md); line-height: 1.5; }

/* Shared buttons */
.sha-upload-btn,
.sha-secondary-btn,
.sha-snapshot-btn,
.sha-manage-benpos-btn,
.sha-weekly-pdf-btn,
.sha-email-pdf-btn,
.sha-holding-search-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--sha-radius-md);
  font-size: var(--sha-font-sm);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.sha-upload-btn {
  padding: 0 15px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #7454f7, #6746ef);
  color: #fff;
  box-shadow: 0 7px 18px rgba(108, 76, 245, .16);
}
.sha-secondary-btn, .sha-snapshot-btn, .sha-manage-benpos-btn, .sha-weekly-pdf-btn, .sha-email-pdf-btn, .sha-holding-search-btn {
  padding: 0 12px;
  border: 1px solid var(--sha-border);
  background: #fff;
  color: #62687a;
}
.sha-secondary-btn:hover, .sha-snapshot-btn:hover, .sha-manage-benpos-btn:hover, .sha-weekly-pdf-btn:hover, .sha-email-pdf-btn:hover, .sha-holding-search-btn:hover {
  border-color: #d2c8ff;
  background: #f8f6ff;
  color: #6046df;
}
.sha-secondary-btn:disabled, .sha-snapshot-btn:disabled, .sha-upload-btn:disabled { opacity: .5; cursor: not-allowed; }
.sha-upload-btn svg, .sha-secondary-btn svg, .sha-snapshot-btn svg, .sha-manage-benpos-btn svg, .sha-weekly-pdf-btn svg, .sha-email-pdf-btn svg { width: 15px; height: 15px; }

/* 03 — HEADER */
.sha-page-head {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto;
  align-items: end;
  gap: 20px;
  margin-bottom: 14px;
}
.sha-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #7564ce;
  font-size: var(--sha-font-xs);
  font-weight: 800;
  letter-spacing: 1.15px;
}
.sha-eyebrow span { width: 6px; height: 6px; border-radius: 50%; background: var(--sha-purple); }
.sha-page-copy h1 { margin: 6px 0 5px; font-size: var(--sha-font-2xl); line-height: 1; letter-spacing: -.9px; }
.sha-page-copy h1 strong { color: var(--sha-purple-strong); }
.sha-page-copy p { max-width: 760px; margin: 0; color: var(--sha-muted); font-size: var(--sha-font-md); line-height: 1.45; }
.sha-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

/* Company selector */
.sha-company-search { position: relative; width: 250px; min-width: 210px; z-index: 120; }
.sha-company-search-field {
  height: 44px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--sha-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--sha-shadow-sm);
}
.sha-company-search.open .sha-company-search-field,
.sha-company-search-field:focus-within { border-color: #c9bcff; box-shadow: 0 0 0 3px rgba(108, 76, 245, .08); }
.sha-company-search-icon, .sha-company-search-end { width: 16px; height: 16px; color: #775fe3; }
.sha-company-search-end { color: #9b96ad; }
.sha-company-search-field input {
  width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #3d4254;
  font-size: var(--sha-font-md); font-weight: 700;
}
.sha-company-search-field input::-webkit-search-cancel-button { display: none; }
.sha-company-search-field input::placeholder { color: #9ca1b2; }
.sha-company-search-menu {
  position: absolute; top: calc(100% + 7px); left: 0; right: 0; max-height: 330px; overflow: auto;
  padding: 6px; border: 1px solid var(--sha-border); border-radius: 14px; background: #fff; box-shadow: var(--sha-shadow-md);
}
.sha-company-search-option {
  width: 100%; min-height: 42px; display: grid; grid-template-columns: 30px minmax(0, 1fr) 18px; align-items: center; gap: 8px;
  padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--sha-text); text-align: left; cursor: pointer;
}
.sha-company-search-option:hover, .sha-company-search-option.keyboard-active { background: #f7f5ff; }
.sha-company-search-option.active { background: #faf9ff; }
.sha-company-search-option-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--sha-purple-soft); color: var(--sha-purple-strong); }
.sha-company-search-option-icon svg { width: 14px; height: 14px; }
.sha-company-search-option-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--sha-font-sm); font-weight: 700; }
.sha-company-search-check { width: 15px; height: 15px; color: var(--sha-purple); opacity: 0; }
.sha-company-search-option.active .sha-company-search-check { opacity: 1; }
.sha-company-search-option.filtered-out { display: none; }
.sha-company-search-empty { padding: 16px 10px; color: var(--sha-muted); text-align: center; font-size: var(--sha-font-sm); }

/* Snapshot navigation */
.sha-snapshot-nav {
  display: grid;
  grid-template-columns: 38px auto 38px;
  align-items: stretch;
  gap: 6px;
  flex: 0 0 auto;
}
.sha-nav-arrow {
  width: 38px; min-height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid var(--sha-border);
  border-radius: 13px; background: #fff; color: #6b7183; cursor: pointer;
}
.sha-nav-arrow:hover:not(:disabled) { border-color: #d2c8ff; color: #6046df; background: #f8f6ff; }
.sha-nav-arrow:disabled { opacity: .4; cursor: not-allowed; }
.sha-nav-arrow svg { width: 15px; height: 15px; }
.sha-nav-center {
  min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid var(--sha-border);
  border-radius: 14px; background: #fff; box-shadow: var(--sha-shadow-sm);
}
.sha-market-range {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--sha-range-gap);
  padding: 3px;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--sha-range-border);
  border-radius: 10px;
  background: var(--sha-range-bg);
}
.sha-market-range::-webkit-scrollbar { display: none; }
.sha-market-range-btn {
  min-width: var(--sha-range-min-w);
  height: var(--sha-range-height);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--sha-range-pad-x);
  border: 0;
  border-radius: var(--sha-range-radius);
  background: transparent;
  color: var(--sha-range-text);
  font-size: var(--sha-range-font-size);
  font-weight: var(--sha-range-font-weight);
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.sha-market-range-btn:hover { color: var(--sha-range-active-text); }
.sha-market-range-btn.active,
.sha-market-range-btn[aria-pressed="true"] {
  background: var(--sha-range-active-bg);
  color: var(--sha-range-active-text);
  box-shadow: var(--sha-shadow-sm);
}
.sha-nav-copy { width: 116px; min-width: 116px; padding: 0 4px 0 3px; }
.sha-nav-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3e4254; font-size: var(--sha-font-sm); font-weight: 800; }
.sha-nav-copy small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sha-muted); font-size: var(--sha-font-xs); }
.sha-weekly-pdf-btn,
.sha-email-pdf-btn {
  min-height: 44px;
  white-space: nowrap;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #d8d0ff;
  background: #fbfaff;
  color: var(--sha-purple-strong);
  box-shadow: none;
}
.sha-weekly-pdf-btn svg,
.sha-email-pdf-btn svg { color: var(--sha-purple); }
.sha-manage-benpos-btn { min-height: 44px; white-space: nowrap; }
.sha-manage-benpos-btn svg { color: var(--sha-purple); }
.sha-holding-search-btn { width: 44px; min-width: 44px; height: 44px; padding: 0; }
.sha-holding-search-btn svg { width: 17px; height: 17px; }

/* 04 — CONTENT / MANAGE BENPOS */
.sha-content { display: grid; gap: 12px; }
.sha-snapshot-panel {
  border: 1px solid #e4dff4; border-radius: var(--sha-radius-lg); background: linear-gradient(180deg, #fff, #fcfbff); overflow: hidden;
}
.sha-manage-panel { padding: 13px 14px; }
.sha-manage-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.sha-manage-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sha-manage-title > span { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 11px; background: var(--sha-purple-soft); color: var(--sha-purple); }
.sha-manage-title > span svg { width: 17px; height: 17px; }
.sha-manage-title strong { font-size: var(--sha-font-lg); }
.sha-manage-actions { display: flex; align-items: center; gap: 8px; }
.sha-manage-actions .sha-snapshot-btn.primary { border-color: transparent; background: linear-gradient(135deg, #7454f7, #6746ef); color: #fff; }

.sha-benpos-monitor { margin-top: 12px; padding-top: 11px; border-top: 1px solid #ece8f6; }
.sha-benpos-monitor-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sha-benpos-monitor-label { display: inline-flex; align-items: center; gap: 7px; color: #4a4f61; }
.sha-benpos-monitor-label svg { width: 14px; height: 14px; color: var(--sha-purple); }
.sha-benpos-monitor-label strong { font-size: var(--sha-font-sm); }
.sha-benpos-monitor-legend { display: flex; align-items: center; gap: 10px; color: var(--sha-muted); font-size: var(--sha-font-xs); font-weight: 700; }
.sha-benpos-monitor-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sha-benpos-monitor-legend i { width: 7px; height: 7px; border-radius: 50%; }
.sha-benpos-monitor-legend .uploaded i { background: #189567; }
.sha-benpos-monitor-legend .missing i { background: #e692a0; }
.sha-benpos-monitor-strip { display: flex; align-items: stretch; gap: 7px; overflow-x: auto; padding: 2px 1px 5px; scrollbar-width: thin; }
.sha-benpos-day {
  min-width: 76px; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 6px; border: 1px solid var(--sha-border); border-radius: 11px; background: #fff;
}
.sha-benpos-day.complete { border-color: #d3eadf; background: #f8fcfa; }
.sha-benpos-day.partial { border-color: #ede1c8; background: #fffcf5; }
.sha-benpos-day.missing { border-color: #efd9de; background: #fffafb; }
.sha-benpos-day.selected { border-color: #bfb0ff; box-shadow: 0 0 0 2px rgba(108, 76, 245, .08); }
.sha-benpos-day > strong { font-size: var(--sha-font-sm); color: #44495b; }
.sha-benpos-day > div { display: flex; gap: 4px; }
.sha-benpos-file-chip { width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 6px; font-size: var(--sha-font-xs); font-weight: 800; }
.sha-benpos-file-chip.uploaded { background: #e7f7ef; color: #18835f; }
.sha-benpos-file-chip.missing { background: #fff0f3; color: #c05d71; }
.sha-benpos-monitor-empty { padding: 12px; color: var(--sha-muted); font-size: var(--sha-font-sm); }

/* 05 — METRICS */
.sha-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.sha-metrics article { min-height: 64px; display: flex; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid var(--sha-border); border-radius: 14px; background: #fff; }
.sha-metrics .icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 10px; }
.sha-metrics .icon svg { width: 17px; height: 17px; }
.sha-metrics .purple, .sha-metrics .indigo { background: var(--sha-purple-soft); color: var(--sha-purple); }
.sha-metrics .green { background: var(--sha-success-soft); color: var(--sha-success); }
.sha-metrics .amber { background: #fff6e7; color: #c37a18; }
.sha-metrics .rose { background: var(--sha-danger-soft); color: var(--sha-danger); }
.sha-metrics small { display: block; color: #858b9e; font-size: var(--sha-font-xs); font-weight: 800; letter-spacing: .45px; text-transform: uppercase; }
.sha-metrics strong { display: block; margin-top: 4px; color: #373b4d; font-size: 17px; line-height: 1; }

/* 06 — SHARED CARDS */
.sha-card, .sha-market-card { border: 1px solid var(--sha-border); border-radius: var(--sha-radius-lg); background: #fff; }
.sha-card { padding: 12px; }
.sha-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.sha-card-head > div > span { display: block; color: #8274c1; font-size: var(--sha-font-xs); font-weight: 800; letter-spacing: .7px; }
.sha-card-head h2 { margin: 3px 0 0; color: #383c4e; font-size: 15px; line-height: 1.15; }
.sha-card-title-only h2 { margin-top: 0; }
.sha-card-head h2 strong { color: var(--sha-purple-strong); }
.sha-card-head p { margin: 4px 0 0; color: var(--sha-muted); font-size: var(--sha-font-sm); line-height: 1.45; }
.sha-small-pill { min-height: 28px; display: inline-flex; align-items: center; padding: 0 9px; border: 1px solid #ded7fb; border-radius: 999px; background: var(--sha-purple-surface); color: #684fd8; font-size: var(--sha-font-xs); font-weight: 800; white-space: nowrap; }
.sha-chart { min-height: 220px; }
.sha-chart-empty { min-height: 160px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px; color: var(--sha-muted); font-size: var(--sha-font-sm); text-align: center; }
.sha-chart-empty svg { width: 18px; height: 18px; }

/* 07 — MARKET CONTEXT */
.sha-market-card { position: relative; z-index: 8; overflow: visible; padding: 13px 14px 10px; }
.sha-market-head { margin-bottom: 2px; }
.sha-market-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.sha-market-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border: 1px solid #ded6ff; border-radius: 11px; background: var(--sha-purple-soft); color: var(--sha-purple-strong); }
.sha-market-icon svg { width: 19px; height: 19px; }
.sha-market-copy { min-width: 0; }
.sha-market-title h2 { margin: 0; color: #393d50; font-size: 16px; line-height: 1.15; }
.sha-market-title h2 strong { color: var(--sha-purple-strong); }
.sha-market-title h2 span { color: #45495b; font-weight: 700; }
.sha-market-title p { margin: 4px 0 0; color: var(--sha-muted); font-size: var(--sha-font-sm); line-height: 1.35; }
#shaMarketChart, #shaMarketChart .apexcharts-canvas { overflow: visible; }
#shaMarketChart .apexcharts-tooltip { overflow: visible !important; max-width: none !important; z-index: 120 !important; }
.sha-market-smart-tip { min-width: 300px; width: max-content; max-width: min(620px, calc(100vw - 40px)); padding: 10px 11px; border: 1px solid #ddd8f3; border-radius: 12px; background: #fff; color: #393d4f; box-shadow: var(--sha-shadow-md); }
.sha-market-smart-tip-date { padding-bottom: 7px; border-bottom: 1px solid #eeeaf7; color: #6657a9; font-size: var(--sha-font-xs); font-weight: 800; letter-spacing: .35px; text-transform: uppercase; }
.sha-market-smart-tip-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 0 4px; }
.sha-market-smart-tip-metrics span { padding: 7px 8px; border-radius: 9px; background: var(--sha-surface-soft); }
.sha-market-smart-tip-metrics small { display: block; color: #8c91a3; font-size: var(--sha-font-xs); font-weight: 800; text-transform: uppercase; }
.sha-market-smart-tip-metrics b { display: block; margin-top: 2px; font-size: var(--sha-font-sm); }
.sha-market-deal-tip { margin-top: 6px; padding-top: 7px; border-top: 1px solid #eeeaf7; }
.sha-market-deal-tip-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.sha-market-deal-tip-head strong { color: #4f32c8; font-size: var(--sha-font-xs); }
.sha-market-deal-tip-head span { min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; border-radius: 999px; background: var(--sha-purple-soft); color: #654ce0; font-size: var(--sha-font-xs); font-weight: 800; }
.sha-market-deal-tip-row { display: grid; grid-template-columns: minmax(210px, 1fr) auto; gap: 12px; align-items: start; padding: 6px 0; border-top: 1px dashed #eeeaf5; }
.sha-market-deal-tip-row:first-of-type { border-top: 0; }
.sha-market-deal-tip-row b { display: block; max-width: 360px; color: #3d4151; font-size: var(--sha-font-xs); line-height: 1.3; }
.sha-market-deal-tip-row small { display: block; margin-top: 2px; color: #8c91a1; font-size: var(--sha-font-xs); line-height: 1.35; }
.sha-market-deal-tip-num { color: #505568; font-size: var(--sha-font-xs); font-weight: 700; text-align: right; white-space: nowrap; }
.sha-market-deal-tip-num small { color: #6b53d7; font-weight: 800; }

/* 08 — OWNERSHIP / MOVERS */
.sha-four-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.sha-quad-card { min-width: 0; display: flex; flex-direction: column; padding: 11px; overflow: hidden; }
.sha-table-wrap { overflow: auto; }
.sha-four-grid .sha-table-wrap { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.sha-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sha-four-grid .sha-table { height: 100%; }
.sha-table th { padding: 7px; border-bottom: 1px solid #ebe9ef; color: #8d93a6; font-size: var(--sha-font-xs); font-weight: 800; text-align: right; text-transform: uppercase; letter-spacing: .35px; }
.sha-table td { padding: 8px 7px; border-bottom: 1px solid #f0eef3; color: var(--sha-text); font-size: var(--sha-font-sm); text-align: right; }
.sha-table th:first-child, .sha-table td:first-child { text-align: left; }
.sha-table td:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3e4254; font-weight: 700; }
.sha-table th:not(:first-child), .sha-table td:not(:first-child) { width: 62px; }


/* Shareholding Pattern + Top External Shareholders — detailed history modal */
.sha-external-main-row,
.sha-pattern-main-row {
  cursor: pointer;
  transition: background-color var(--sha-history-modal-transition) ease, box-shadow var(--sha-history-modal-transition) ease;
}
.sha-external-main-row:hover,
.sha-external-main-row:focus-visible,
.sha-pattern-main-row:hover,
.sha-pattern-main-row:focus-visible {
  background: var(--sha-history-row-hover-bg);
  box-shadow: inset 0 0 0 1px var(--sha-history-modal-border);
}

body.sha-history-modal-open { overflow: hidden; }
.sha-history-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1690;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(38,39,51,.42);
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--sha-history-modal-transition) ease, visibility var(--sha-history-modal-transition) ease;
}
.sha-history-modal-backdrop.show { opacity: 1; visibility: visible; pointer-events: auto; }
.sha-history-modal {
  width: min(var(--sha-history-modal-width), calc(100vw - 28px));
  height: min(var(--sha-history-modal-height), var(--sha-history-modal-max-h));
  max-height: var(--sha-history-modal-max-h);
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  overflow: hidden;
  border: 1px solid var(--sha-history-modal-border);
  border-radius: var(--sha-history-modal-radius);
  background: var(--sha-surface);
  box-shadow: var(--sha-history-modal-shadow);
  transform: translateY(8px) scale(.985);
  transition: transform var(--sha-history-modal-transition) ease;
}
.sha-history-modal-backdrop.show .sha-history-modal { transform: translateY(0) scale(1); }
.sha-history-modal-head {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px var(--sha-history-modal-pad);
  border-bottom: 1px solid var(--sha-history-modal-border);
  background: var(--sha-surface);
}
.sha-history-modal-head-copy { min-width: 0; }
.sha-history-modal-kicker {
  display: block;
  color: var(--sha-purple);
  font-size: var(--sha-history-modal-label-size);
  line-height: 1;
  font-weight: var(--sha-history-modal-title-weight);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.sha-history-modal-head h2 {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--sha-ink);
  font-size: var(--sha-history-modal-title-size);
  line-height: var(--sha-overlay-line-tight);
  font-weight: var(--sha-history-modal-title-weight);
  letter-spacing: -.2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sha-history-modal-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sha-history-modal-meta-gap);
  margin-top: 6px;
}
.sha-history-modal-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--sha-muted);
  font-size: var(--sha-history-modal-meta-size);
  line-height: 1.25;
  font-weight: var(--sha-history-modal-helper-weight);
}
.sha-history-modal-meta > span + span {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--sha-history-modal-pill-border);
  border-radius: 999px;
  background: var(--sha-history-modal-pill-bg);
  color: var(--sha-purple-strong);
  font-weight: var(--sha-history-modal-meta-weight);
}
.sha-history-modal-meta svg { width: 12px; height: 12px; }
.sha-history-modal-close {
  width: var(--sha-history-modal-close-size);
  height: var(--sha-history-modal-close-size);
  flex: 0 0 var(--sha-history-modal-close-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--sha-border);
  border-radius: var(--sha-radius-md);
  background: var(--sha-surface);
  color: var(--sha-muted);
  cursor: pointer;
  transition: border-color var(--sha-history-modal-transition) ease, background var(--sha-history-modal-transition) ease, color var(--sha-history-modal-transition) ease;
}
.sha-history-modal-close:hover { border-color: var(--sha-border-strong); background: var(--sha-purple-surface); color: var(--sha-purple-strong); }
.sha-history-modal-close svg { width: var(--sha-history-modal-close-icon-size); height: var(--sha-history-modal-close-icon-size); pointer-events: none; }
.sha-history-modal-body {
  min-height: 0;
  display: grid;
  grid-template-rows: auto var(--sha-history-modal-trend-h) minmax(0,1fr);
  gap: var(--sha-history-modal-gap);
  overflow: hidden;
  padding: var(--sha-history-modal-pad);
}
.sha-history-modal-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: var(--sha-history-modal-summary-gap);
  margin: 0;
}
.sha-history-modal-stat {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: var(--sha-history-modal-stat-pad-y) var(--sha-history-modal-stat-pad-x);
  border: 1px solid var(--sha-history-modal-summary-border);
  border-radius: var(--sha-history-modal-section-radius);
  background: var(--sha-history-modal-summary-bg);
}
.sha-history-modal-stat:first-child { border-color: var(--sha-border-strong); background: var(--sha-purple-soft); }
.sha-history-modal-stat-icon {
  width: var(--sha-history-modal-icon-size);
  height: var(--sha-history-modal-icon-size);
  flex: 0 0 var(--sha-history-modal-icon-size);
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--sha-surface);
  color: var(--sha-purple-strong);
  box-shadow: inset 0 0 0 1px var(--sha-border);
}
.sha-history-modal-stat.is-up .sha-history-modal-stat-icon { background: var(--sha-success-soft); color: var(--sha-success); box-shadow: none; }
.sha-history-modal-stat.is-down .sha-history-modal-stat-icon { background: var(--sha-danger-soft); color: var(--sha-danger); box-shadow: none; }
.sha-history-modal-stat-icon svg { width: var(--sha-history-modal-icon-glyph-size); height: var(--sha-history-modal-icon-glyph-size); }
.sha-history-modal-stat-copy { min-width: 0; }
.sha-history-modal-stat-copy > span {
  display: block;
  overflow: hidden;
  color: var(--sha-muted);
  font-size: var(--sha-history-modal-label-size);
  line-height: 1.2;
  font-weight: var(--sha-history-modal-label-weight);
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.sha-history-modal-stat-copy > strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--sha-ink);
  font-size: var(--sha-history-modal-stat-size);
  line-height: 1.05;
  font-weight: var(--sha-history-modal-stat-weight);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sha-history-modal-stat-copy > strong.up { color: var(--sha-success); }
.sha-history-modal-stat-copy > strong.down { color: var(--sha-danger); }

.sha-history-modal-stat.is-action {
  position: relative;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  transition: border-color var(--sha-history-modal-transition) ease, background var(--sha-history-modal-transition) ease, box-shadow var(--sha-history-modal-transition) ease;
}
.sha-history-modal-stat.is-action:hover,
.sha-history-modal-stat.is-action:focus-visible,
.sha-history-modal-stat.is-action.is-selected {
  border-color: var(--sha-purple);
  background: var(--sha-purple-soft);
  box-shadow: 0 0 0 2px var(--sha-purple-surface);
  outline: none;
}
.sha-history-modal-stat-affordance {
  width: var(--sha-history-modal-action-icon-size);
  height: var(--sha-history-modal-action-icon-size);
  flex: 0 0 var(--sha-history-modal-action-icon-size);
  margin-left: auto;
  color: var(--sha-purple);
}
.sha-history-modal-section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--sha-history-modal-border);
  border-radius: var(--sha-history-modal-section-radius);
  background: var(--sha-surface);
}
.sha-history-modal-section-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--sha-history-modal-border);
  background: var(--sha-surface-soft);
}
.sha-history-modal-section-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.sha-history-modal-section-icon {
  width: var(--sha-history-modal-section-icon-size);
  height: var(--sha-history-modal-section-icon-size);
  flex: 0 0 var(--sha-history-modal-section-icon-size);
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--sha-purple-soft);
  color: var(--sha-purple-strong);
}
.sha-history-modal-section-icon svg { width: var(--sha-history-modal-icon-glyph-size); height: var(--sha-history-modal-icon-glyph-size); }
.sha-history-modal-section-copy { min-width: 0; }
.sha-history-modal-section-copy strong {
  display: block;
  color: var(--sha-ink);
  font-size: var(--sha-history-modal-section-title-size);
  line-height: 1.2;
  font-weight: var(--sha-history-modal-section-title-weight);
}
.sha-history-modal-section-copy span {
  display: block;
  margin-top: 2px;
  color: var(--sha-muted);
  font-size: var(--sha-history-modal-meta-size);
  line-height: 1.3;
  font-weight: var(--sha-history-modal-helper-weight);
}
.sha-history-modal-chart-metrics {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  flex: 0 0 auto;
}
.sha-history-modal-chart-metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--sha-history-modal-pill-border);
  border-radius: 999px;
  background: var(--sha-surface);
  color: var(--sha-muted);
  font-size: var(--sha-history-modal-label-size);
  font-weight: var(--sha-history-modal-label-weight);
}
.sha-history-modal-chart-metric svg { width: 12px; height: 12px; color: var(--sha-purple); }
.sha-history-modal-chart-metric b {
  color: var(--sha-ink);
  font-size: var(--sha-history-modal-meta-size);
  font-weight: var(--sha-history-modal-stat-weight);
}

.sha-history-modal-panel-action { cursor: pointer; font: inherit; }
.sha-history-modal-panel-action:hover,
.sha-history-modal-panel-action:focus-visible {
  border-color: var(--sha-purple);
  background: var(--sha-purple-surface);
  color: var(--sha-purple-strong);
  outline: none;
}
.sha-history-modal-chart-scroll {
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: var(--sha-history-modal-chart-pad-y) var(--sha-history-modal-chart-pad-x) 0;
  scrollbar-color: var(--sha-border-strong) transparent;
}
.sha-history-modal-chart {
  display: block;
  height: var(--sha-history-modal-chart-h);
  min-width: var(--sha-history-modal-chart-min-w);
}
.sha-history-modal-gridline { stroke: var(--sha-history-modal-grid); stroke-width: 1; stroke-dasharray: 4 5; }
.sha-history-modal-area { fill: var(--sha-history-modal-area); opacity: .42; }
.sha-history-modal-line { fill: none; stroke: var(--sha-history-modal-line); stroke-width: var(--sha-history-modal-line-width); stroke-linecap: round; stroke-linejoin: round; }
.sha-history-modal-point { fill: var(--sha-history-modal-point-fill); stroke: var(--sha-history-modal-point-stroke); stroke-width: var(--sha-history-modal-point-width); }
.sha-history-modal-point.is-latest { fill: var(--sha-purple); stroke: var(--sha-purple); }
.sha-history-modal-point-value {
  fill: var(--sha-ink);
  stroke: var(--sha-surface);
  stroke-width: 3px;
  paint-order: stroke;
  font-size: var(--sha-history-modal-meta-size);
  font-weight: var(--sha-history-modal-title-weight);
}
.sha-history-modal-point-date { fill: var(--sha-muted); font-size: var(--sha-history-modal-x-label-size); font-weight: var(--sha-history-modal-meta-weight); }
.sha-history-modal-axis-label { fill: var(--sha-muted-2); font-size: var(--sha-history-modal-label-size); font-weight: var(--sha-history-modal-meta-weight); }
.sha-history-modal-table-wrap {
  min-height: 0;
  height: 100%;
  overflow: auto;
  scrollbar-color: var(--sha-border-strong) transparent;
}
.sha-history-modal-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sha-history-modal-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: var(--sha-history-modal-table-row-h);
  padding: 0 10px;
  border-bottom: 1px solid var(--sha-history-modal-border);
  background: var(--sha-history-modal-table-head-bg);
  color: var(--sha-muted);
  font-size: var(--sha-history-modal-label-size);
  font-weight: var(--sha-history-modal-title-weight);
  text-align: right;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.sha-history-modal-table td {
  height: var(--sha-history-modal-table-row-h);
  padding: 0 10px;
  border-bottom: 1px solid var(--sha-border);
  color: var(--sha-text);
  font-size: var(--sha-history-modal-meta-size);
  font-weight: var(--sha-history-modal-meta-weight);
  text-align: right;
  white-space: nowrap;
}
.sha-history-modal-table th:first-child,
.sha-history-modal-table td:first-child { text-align: left; }
.sha-history-modal-table tbody tr.is-latest td { background: var(--sha-history-modal-latest-bg); }
.sha-history-modal-table tbody tr:last-child td { border-bottom: 0; }
.sha-history-modal-table .up { color: var(--sha-success); font-weight: var(--sha-history-modal-title-weight); }
.sha-history-modal-table .down { color: var(--sha-danger); font-weight: var(--sha-history-modal-title-weight); }
.sha-history-modal-table .flat { color: var(--sha-muted); }
.sha-history-modal-table-section[data-sha-history-members-panel] { min-height: 0; display: flex; flex-direction: column; }
.sha-history-modal-table-section[hidden] { display: none !important; }
.sha-history-members-content { min-height: 0; height: 100%; display: flex; flex-direction: column; }
.sha-history-members-loading { min-height: 0; height: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--sha-muted); font-size: var(--sha-history-modal-meta-size); font-weight: var(--sha-history-modal-helper-weight); }
.sha-history-members-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  flex: 0 0 auto;
  padding: var(--sha-history-modal-member-note-pad-y) var(--sha-history-modal-member-note-pad-x);
  border-bottom: 1px solid var(--sha-history-modal-border);
  background: var(--sha-purple-surface);
  color: var(--sha-muted);
  font-size: var(--sha-history-modal-member-note-size);
  line-height: var(--sha-overlay-line-body);
  font-weight: var(--sha-history-modal-helper-weight);
}
.sha-history-members-note svg { width: var(--sha-history-modal-action-icon-size); height: var(--sha-history-modal-action-icon-size); flex: 0 0 var(--sha-history-modal-action-icon-size); margin-top: 1px; color: var(--sha-purple); }
.sha-history-members-note b { color: var(--sha-ink); font-weight: var(--sha-history-modal-label-weight); }
.sha-history-members-table-wrap { min-height: 0; height: auto; flex: 1 1 auto; }
.sha-history-members-table th:first-child, .sha-history-members-table td:first-child { width: 48%; }
.sha-history-members-table th:nth-child(2), .sha-history-members-table td:nth-child(2) { width: 20%; }
.sha-history-members-table th:nth-child(3), .sha-history-members-table td:nth-child(3) { width: 16%; }
.sha-history-members-table th:nth-child(4), .sha-history-members-table td:nth-child(4) { width: 16%; }
.sha-history-member-name { display: block; overflow: hidden; color: var(--sha-ink); font-size: var(--sha-history-modal-member-name-size); font-weight: var(--sha-history-modal-label-weight); text-overflow: ellipsis; white-space: nowrap; }
.sha-history-member-source { display: block; margin-top: 2px; color: var(--sha-muted-2); font-size: var(--sha-history-modal-member-note-size); font-weight: var(--sha-history-modal-helper-weight); }
.sha-history-members-footer { flex: 0 0 auto; padding: 7px 10px; border-top: 1px solid var(--sha-history-modal-border); background: var(--sha-surface-soft); text-align: center; }
.sha-history-members-more { min-height: 28px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 10px; border: 1px solid var(--sha-history-modal-pill-border); border-radius: 999px; background: var(--sha-surface); color: var(--sha-purple-strong); font-size: var(--sha-history-modal-label-size); font-weight: var(--sha-history-modal-label-weight); cursor: pointer; }
.sha-history-members-more:hover { background: var(--sha-purple-surface); border-color: var(--sha-purple); }
.sha-history-members-more svg { width: var(--sha-history-modal-action-icon-size); height: var(--sha-history-modal-action-icon-size); }

.sha-history-modal-latest {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid var(--sha-history-modal-pill-border);
  border-radius: 999px;
  background: var(--sha-history-modal-pill-bg);
  color: var(--sha-purple-strong);
  font-size: var(--sha-history-modal-label-size);
  font-weight: var(--sha-history-modal-label-weight);
  vertical-align: middle;
}
.sha-history-modal-empty {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 18px;
  color: var(--sha-muted);
  font-size: var(--sha-history-modal-body-size);
  font-weight: var(--sha-history-modal-body-weight);
  text-align: center;
}

.sha-table tr:last-child td { border-bottom: 0; }
.sha-table-empty-row td { height: 120px; color: var(--sha-muted); font-weight: 600; text-align: center !important; }
.sha-delta { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 0; font-size: var(--sha-font-sm); font-weight: 700; }
.sha-delta.up { color: #1d9b78; }
.sha-delta.down { color: #d05b72; }
.sha-delta.flat { color: #9297a7; }
.sha-mover-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; }
.sha-mover-icon.buy { background: var(--sha-success-soft); color: var(--sha-success); }
.sha-mover-icon.sell { background: var(--sha-danger-soft); color: var(--sha-danger); }
.sha-mover-icon svg { width: 15px; height: 15px; }
.sha-mover-head, .sha-mover-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px 80px; gap: 6px; align-items: center; }
.sha-mover-head { padding: 7px; border-bottom: 1px solid #eceaf0; color: #8d93a6; font-size: var(--sha-font-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .35px; }
.sha-mover-head span:not(:first-child) { text-align: right; }
.sha-mover-list { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.sha-mover-row { flex: 1 1 0; min-height: 40px; padding: 7px; border-bottom: 1px solid #f0eef3; }
.sha-mover-row:last-child { border-bottom: 0; }
.sha-mover-row > div { min-width: 0; overflow: hidden; }
.sha-mover-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3e4254; font-size: var(--sha-font-sm); }
.sha-mover-row small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9196a7; font-size: var(--sha-font-xs); }
.sha-mover-row .num { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #565b6d; font-size: var(--sha-font-sm); font-weight: 700; text-align: right; }
.sha-mover-row .move.buy { color: #1f9a78; }
.sha-mover-row .move.sell { color: #cf5d72; }

/* 09 — LARGE DEALS */
.sha-large-deals-card { padding: 13px 14px 12px; }
.sha-large-deals-head { align-items: center; margin-bottom: 10px; }
.sha-large-deals-summary { display: grid; grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.sha-large-deal-stat { min-width: 0; padding: 10px; border: 1px solid #ebe8f2; border-radius: 11px; background: #fcfbfe; }
.sha-large-deal-stat.primary { border-color: #dfd8fa; background: var(--sha-purple-surface); }
.sha-large-deal-stat small { display: block; color: #8f95a7; font-size: var(--sha-font-xs); font-weight: 800; letter-spacing: .4px; text-transform: uppercase; }
.sha-large-deal-stat strong { display: block; margin-top: 4px; color: #393d50; font-size: 16px; line-height: 1.1; }
.sha-large-deal-stat.primary strong { color: #5a3bd1; }
.sha-large-deal-stat span { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9297a8; font-size: var(--sha-font-xs); }
.sha-large-deals-table-wrap { max-height: 330px; overflow: auto; border: 1px solid #ebe8f1; border-radius: 11px; background: #fff; }
.sha-large-deals-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.sha-large-deals-table thead { position: sticky; top: 0; z-index: 2; background: var(--sha-surface-soft); }
.sha-large-deals-table th { height: 32px; padding: 0 9px; border-bottom: 1px solid #e7e3ef; color: #878d9f; font-size: var(--sha-font-xs); font-weight: 800; letter-spacing: .35px; text-align: left; text-transform: uppercase; }
.sha-large-deals-table td { height: 38px; padding: 6px 9px; border-bottom: 1px solid #f0edf4; color: var(--sha-text); font-size: var(--sha-font-sm); vertical-align: middle; }
.sha-large-deals-table tbody tr:last-child td { border-bottom: 0; }
.sha-large-deals-table tbody tr:hover { background: var(--sha-surface-soft); }
.sha-large-deals-table th:nth-child(1), .sha-large-deals-table td:nth-child(1) { width: 104px; }
.sha-large-deals-table th:nth-child(2), .sha-large-deals-table td:nth-child(2) { width: 112px; }
.sha-large-deals-table th:nth-child(4), .sha-large-deals-table td:nth-child(4) { width: 76px; }
.sha-large-deals-table th:nth-child(5), .sha-large-deals-table td:nth-child(5) { width: 116px; text-align: right; }
.sha-large-deals-table th:nth-child(6), .sha-large-deals-table td:nth-child(6) { width: 104px; text-align: right; }
.sha-large-deals-table th:nth-child(7), .sha-large-deals-table td:nth-child(7) { width: 120px; text-align: right; }
.sha-large-deals-table td.date { color: #73788a; font-weight: 700; white-space: nowrap; }
.sha-large-deals-table td.investor { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3f4354; font-weight: 700; }
.sha-large-deals-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sha-large-deals-table td.value { color: #5b48ae; font-weight: 800; }
.sha-deal-type, .sha-deal-side { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 0 7px; border-radius: 999px; font-size: var(--sha-font-xs); font-weight: 800; }
.sha-deal-type.bulk { background: var(--sha-purple-soft); color: #6547d8; }
.sha-deal-type.block { background: #ece8f8; color: #4e3d93; }
.sha-large-deals-table td:nth-child(2) small { margin-left: 5px; color: #969bad; font-size: var(--sha-font-xs); font-weight: 700; }
.sha-deal-side { min-width: 42px; }
.sha-deal-side.buy { background: var(--sha-success-soft); color: #22866c; }
.sha-deal-side.sell { background: var(--sha-danger-soft); color: #bd5069; }
.sha-deal-side.neutral { background: #f2f2f5; color: #7d8190; }
.sha-large-deals-empty { height: 118px; text-align: center; color: #9297a8; }
.sha-large-deals-empty svg { width: 18px; height: 18px; margin: 0 auto 5px; color: #8a73e5; }
.sha-large-deals-empty strong, .sha-large-deals-empty span { display: block; }
.sha-large-deals-empty strong { color: var(--sha-text); font-size: var(--sha-font-sm); }
.sha-large-deals-empty span { margin-top: 4px; font-size: var(--sha-font-xs); }
.sha-large-deals-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 24px; padding: 7px 2px 0; color: #9297a8; font-size: var(--sha-font-xs); }
.sha-large-deals-foot span { display: inline-flex; align-items: center; gap: 5px; }
.sha-large-deals-foot svg { width: 11px; height: 11px; color: #7660db; }

/* 10 — HISTORY */
.sha-history-chart { min-height: 250px; }

/* 11 — SHAREHOLDING SEARCH */
.sha-search-backdrop { position: fixed; inset: 0; z-index: 1550; background: rgba(37, 34, 55, .28); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: .18s ease; }
.sha-search-backdrop.show { opacity: 1; visibility: visible; }
.sha-search-drawer {
  position: fixed; top: 14px; right: 14px; bottom: 14px; z-index: 1560; width: min(610px, calc(100vw - 28px));
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--sha-border); border-radius: 18px; background: #fff;
  box-shadow: -24px 0 65px rgba(31, 26, 64, .16); transform: translateX(104%); transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
.sha-search-drawer.show { transform: translateX(0); }
.sha-search-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 19px 16px; border-bottom: 1px solid #eceef3; }
.sha-search-drawer-title { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.sha-search-drawer-icon { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(145deg, #e9e4ff, #f8f6ff); color: #6046d7; }
.sha-search-drawer-icon svg { width: 18px; height: 18px; }
.sha-search-drawer-kicker { display: block; color: #8175bd; font-size: var(--sha-font-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .65px; }
.sha-search-drawer-title h2 { margin: 3px 0 0; color: #282b3e; font-size: 20px; line-height: 1.2; font-weight: 800; }
.sha-search-drawer-title p { margin: 5px 0 0; color: #868c9d; font-size: var(--sha-font-sm); line-height: 1.45; font-weight: 600; }
.sha-search-drawer-close { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 36px; padding: 0; border: 1px solid var(--sha-border); border-radius: 10px; background: #fff; color: #74798c; cursor: pointer; }
.sha-search-drawer-close:hover { border-color: #cfc9e8; background: #faf9ff; color: #5f46d8; }
.sha-search-drawer-close svg { width: 16px; height: 16px; }
.sha-search-drawer-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px 20px; }
.sha-search-tools { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 9px; align-items: start; }
.sha-search-field { height: 46px; display: grid; grid-template-columns: 20px minmax(0,1fr) 30px; align-items: center; gap: 8px; padding: 0 9px 0 13px; border: 1px solid #dddfea; border-radius: 12px; background: #fff; box-shadow: var(--sha-shadow-sm); }
.sha-search-field:focus-within { border-color: #cbbfff; box-shadow: 0 0 0 3px rgba(109,76,255,.08); }
.sha-search-field > svg { width: 16px; height: 16px; color: #8e93a7; }
.sha-search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #35394a; font-size: var(--sha-font-md); font-weight: 600; }
.sha-search-field input::placeholder { color: #9a9fb0; }
.sha-search-clear { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: #f5f3fb; color: #7d8192; cursor: pointer; }
.sha-search-clear svg { width: 13px; height: 13px; }
.sha-search-category-filter { position: relative; min-width: 0; z-index: 70; }
.sha-search-category-trigger { width: 100%; height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid #dddfea; border-radius: 12px; background: #fff; color: #4f5467; cursor: pointer; }
.sha-search-category-trigger:hover { background: #fdfcff; border-color: #d2caee; }
.sha-search-category-filter.open .sha-search-category-trigger, .sha-search-category-trigger:focus-visible { border-color: #cbbfff; box-shadow: 0 0 0 3px rgba(109,76,255,.08); }
.sha-search-category-trigger:disabled { cursor: wait; opacity: .7; }
.sha-search-category-trigger > svg:first-child { width: 15px; height: 15px; color: #7558e8; }
.sha-search-filter-chevron { width: 13px; height: 13px; margin-left: auto; color: #9b9fb0; transition: transform .15s; }
.sha-search-category-filter.open .sha-search-filter-chevron { transform: rotate(180deg); }
.sha-search-category-trigger-copy { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--sha-font-sm); font-weight: 700; }
.sha-search-category-count { min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; border-radius: 999px; background: var(--sha-purple-soft); color: #654ce0; font-size: var(--sha-font-xs); font-weight: 800; }
.sha-search-category-menu { position: absolute; top: calc(100% + 7px); right: 0; width: min(330px, calc(100vw - 42px)); overflow: hidden; border: 1px solid var(--sha-border); border-radius: 13px; background: #fff; box-shadow: var(--sha-shadow-md); }
.sha-search-category-menu-head, .sha-search-category-menu-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 11px; }
.sha-search-category-menu-head { border-bottom: 1px solid #eeecf3; }
.sha-search-category-menu-head strong { display: block; color: #373b4d; font-size: var(--sha-font-sm); }
.sha-search-category-menu-head small { display: block; margin-top: 2px; color: #9297a8; font-size: var(--sha-font-xs); }
.sha-search-category-menu-head button, .sha-search-category-menu-foot button { border: 0; border-radius: 8px; background: transparent; color: #654ce0; font-size: var(--sha-font-xs); font-weight: 800; cursor: pointer; }
.sha-search-category-options { max-height: 300px; overflow: auto; padding: 5px; }
.sha-search-category-loading { padding: 18px 10px; text-align: center; color: var(--sha-muted); font-size: var(--sha-font-sm); }
.sha-search-category-option { min-height: 38px; display: grid; grid-template-columns: 22px minmax(0,1fr); align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; cursor: pointer; }
.sha-search-category-option:hover { background: #f7f5ff; }
.sha-search-category-option[aria-selected="true"] { background: #f3f0ff; }
.sha-search-category-option input { position: absolute; opacity: 0; pointer-events: none; }
.sha-search-category-check { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid #d8d4e4; border-radius: 6px; background: #fff; color: transparent; }
.sha-search-category-check svg { width: 11px; height: 11px; }
.sha-search-category-option input:checked + .sha-search-category-check { border-color: #856cf0; background: #7355eb; color: #fff; }
.sha-search-category-option-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #505568; font-size: var(--sha-font-sm); font-weight: 600; }
.sha-search-category-menu-foot { border-top: 1px solid #eeecf3; background: #fcfbfe; }
.sha-search-category-menu-foot span { min-width: 0; color: #8a90a2; font-size: var(--sha-font-xs); font-weight: 700; }
.sha-search-scope { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 9px 10px; border: 1px solid #ece9f3; border-radius: 10px; background: #faf9fe; }
.sha-search-scope span { display: inline-flex; align-items: center; gap: 6px; color: #6650ce; font-size: var(--sha-font-xs); font-weight: 800; white-space: nowrap; }
.sha-search-scope span svg { width: 12px; height: 12px; }
.sha-search-scope small { color: #8f95a6; font-size: var(--sha-font-xs); text-align: right; }
.sha-search-results-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 15px 2px 8px; }
.sha-search-results-head strong { color: #424658; font-size: var(--sha-font-sm); }
.sha-search-results-head span { color: #8f95a6; font-size: var(--sha-font-xs); }
.sha-search-results { display: grid; gap: 7px; }
.sha-search-empty { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.sha-search-empty > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--sha-purple-soft); color: #6b4ef1; }
.sha-search-empty > span svg { width: 18px; height: 18px; }
.sha-search-empty strong { margin-top: 12px; color: #44485a; font-size: var(--sha-font-md); }
.sha-search-empty p { max-width: 330px; margin: 5px 0 0; color: var(--sha-muted); font-size: var(--sha-font-sm); line-height: 1.5; }
.sha-search-result-row { display: grid; grid-template-columns: minmax(0,1.7fr) 100px 90px 100px auto; gap: 8px; align-items: center; padding: 10px 11px; border: 1px solid #e7e5ee; border-radius: 11px; background: #fff; transition: .14s ease; }
.sha-search-result-row:hover { border-color: #d8d0fb; box-shadow: 0 4px 14px rgba(55,43,111,.05); }
.sha-search-investor-cell { min-width: 0; }
.sha-search-investor-cell strong, .sha-search-investor-cell span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sha-search-investor-cell strong { color: #35394a; font-size: var(--sha-font-sm); font-weight: 800; }
.sha-search-investor-cell span { margin-top: 3px; color: #7f8497; font-size: var(--sha-font-xs); }
.sha-search-row-metric { min-width: 0; text-align: right; }
.sha-search-row-metric small, .sha-search-row-metric span { display: block; color: #959aab; font-size: var(--sha-font-xs); }
.sha-search-row-metric strong { display: block; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #44495b; font-size: var(--sha-font-sm); }
.sha-search-row-metric strong.up { color: #159775; }
.sha-search-row-metric strong.down { color: #d35b72; }
.sha-search-row-metric strong.flat { color: #9499aa; }
.sha-search-date { min-height: 26px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 999px; background: #f6f3ff; color: #6950e0; font-size: var(--sha-font-xs); font-weight: 800; white-space: nowrap; }

/* 12 — UPLOAD MODAL */
.sha-modal-backdrop { position: fixed; inset: 0; z-index: 1600; background: rgba(38,39,51,.42); backdrop-filter: blur(5px); opacity: 0; pointer-events: none; transition: .16s; }
.sha-modal-backdrop.show { opacity: 1; pointer-events: auto; }
.sha-upload-modal {
  position: fixed; z-index: 1601; left: 50%; top: 50%; width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - 28px);
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid #dedbe9; border-radius: 24px; background: #fff; box-shadow: var(--sha-shadow-lg);
  opacity: 0; pointer-events: none; transform: translate(-50%, -48%) scale(.98); transition: .16s;
}
.sha-upload-modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.sha-upload-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 22px 16px; border-bottom: 1px solid #eceaf5; }
.sha-upload-head span {
  display: block; margin-bottom: 6px; color: #7257ec;
  font-size: var(--sha-overlay-label-size); line-height: 1; letter-spacing: .12em;
  font-weight: var(--sha-overlay-title-weight); text-transform: uppercase;
}
.sha-upload-head h2 {
  margin: 0; color: #272b3f;
  font-size: var(--sha-overlay-title-size); line-height: var(--sha-overlay-line-tight);
  font-weight: var(--sha-overlay-title-weight); letter-spacing: -.35px;
}
.sha-upload-head p {
  margin: 6px 0 0; max-width: 520px; color: #757c90;
  font-size: var(--sha-overlay-subtitle-size); line-height: var(--sha-overlay-line-body);
  font-weight: var(--sha-overlay-helper-weight);
}
.sha-upload-head button { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; padding: 0; border: 1px solid #ddddea; border-radius: 14px; background: #fff; color: #7f8395; cursor: pointer; }
.sha-upload-head button:hover { border-color: #cfcce1; color: #5b6175; background: #fbfbfe; }
.sha-upload-head button svg { width: 17px; height: 17px; }
.sha-upload-body { padding: 16px 22px 18px; overflow: auto; }
.sha-dropzone { min-height: 116px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 18px 22px; border: 1px dashed #d8cffb; border-radius: 18px; background: linear-gradient(180deg, #fdfcff 0%, #f8f6ff 100%); text-align: center; cursor: pointer; transition: .16s ease; }
.sha-dropzone:hover, .sha-dropzone.drag { border-color: #bdafff; box-shadow: 0 0 0 4px rgba(111,82,243,.08); background: linear-gradient(180deg,#fdfcff 0%,#f4efff 100%); }
.sha-dropzone input { display: none; }
.sha-drop-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: #f0eaff; color: #6b4ef1; }
.sha-drop-icon svg { width: 20px; height: 20px; }
.sha-drop-copy { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sha-drop-copy strong {
  color: #2d3146; font-size: var(--sha-overlay-section-title-size);
  line-height: var(--sha-overlay-line-tight); font-weight: var(--sha-overlay-section-title-weight);
}
.sha-drop-copy small {
  color: #7d8498; font-size: var(--sha-overlay-helper-size);
  line-height: var(--sha-overlay-line-body); font-weight: var(--sha-overlay-helper-weight);
}
.sha-browse {
  min-height: 30px; display: inline-flex; align-items: center; padding: 0 11px;
  border: 1px solid #dad2ff; border-radius: 9px; background: #fff; color: #644de0;
  font-size: var(--sha-overlay-meta-size); font-weight: var(--sha-overlay-button-weight);
}
.sha-file-slots { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; margin-top: 12px; }
.sha-file-slots article { min-height: 76px; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 10px; border: 1px solid #e5e3eb; border-radius: 13px; background: #fff; }
.sha-file-slots .slot-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--sha-purple-soft); color: var(--sha-purple); }
.sha-file-slots .slot-icon svg { width: 16px; height: 16px; }
.sha-file-slots article > div { min-width: 0; }
.sha-file-slots strong {
  display: block; color: #34394c;
  font-size: var(--sha-overlay-control-size); line-height: 1.25;
  font-weight: var(--sha-overlay-label-weight);
}
.sha-file-slots small {
  display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8c92a4;
  font-size: var(--sha-overlay-meta-size); line-height: 1.3; font-weight: var(--sha-overlay-helper-weight);
}
.sha-file-slots .slot-state {
  font-size: var(--sha-overlay-meta-size); line-height: 1;
  font-weight: var(--sha-overlay-label-weight); color: var(--sha-warning);
}
.sha-file-slots article.ready { border-color: #cfe9df; background: #f9fdfb; }
.sha-file-slots article.ready .slot-state, .sha-file-slots article.verified .slot-state { color: var(--sha-success); }
.sha-file-slots article.verified { border-color: #bfe5d3; background: #f7fcf9; }
.sha-file-slots article.verified .slot-icon { background: #e7f7ef; color: #198760; }
.sha-upload-preview { margin-top: 12px; border: 1px solid #d8eade; border-radius: 15px; background: #f8fcfa; overflow: hidden; }
.sha-preview-title { padding: 11px 12px; border-bottom: 1px solid #e0eee6; }
.sha-preview-title span {
  display: block; color: #278260; font-size: var(--sha-overlay-label-size);
  font-weight: var(--sha-overlay-title-weight); letter-spacing: .08em;
}
.sha-preview-title strong {
  display: inline-block; margin-top: 4px; color: #303648;
  font-size: var(--sha-overlay-body-size); font-weight: var(--sha-overlay-section-title-weight);
}
.sha-preview-title small {
  margin-left: 8px; color: #7f8797;
  font-size: var(--sha-overlay-meta-size); font-weight: var(--sha-overlay-helper-weight);
}
.sha-preview-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; padding: 9px; }
.sha-preview-grid > div { padding: 11px; border: 1px solid #e2eee8; border-radius: 12px; background: #fff; }
.sha-preview-grid small {
  display: block; color: #8490a2; font-size: var(--sha-overlay-label-size);
  font-weight: var(--sha-overlay-label-weight); text-transform: uppercase; letter-spacing: .05em;
}
.sha-preview-grid strong {
  display: block; margin-top: 6px; color: #2d3347;
  font-size: var(--sha-overlay-stat-size); line-height: 1.1; font-weight: var(--sha-overlay-title-weight);
}
.sha-upload-message {
  min-height: 40px; margin-top: 12px; padding: 10px 12px; border: 1px solid #f4e1ad; border-radius: 12px;
  background: #fff8e9; color: #91620f; font-size: var(--sha-overlay-meta-size);
  line-height: var(--sha-overlay-line-helper); font-weight: var(--sha-overlay-meta-weight);
}
.sha-upload-message:empty { display: none; }
.sha-upload-message.ok { border-color: #c8e7d6; background: #eef9f3; color: #1d875c; }
.sha-upload-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px 18px; border-top: 1px solid #eceaf5; }
.sha-upload-footer > div { display: flex; align-items: center; gap: 8px; }
.sha-upload-footer .sha-secondary-btn, .sha-upload-footer .sha-upload-btn {
  min-height: 42px; padding: 0 16px; border-radius: 13px;
  font-size: var(--sha-overlay-control-size); font-weight: var(--sha-overlay-button-weight);
}

/* 13 — RESPONSIVE PROFILES */
/* Monitor / wide desktop: keep approved proportions; do not stretch cards endlessly. */
@media (min-width: 1800px) {
  .sha-page { max-width: 1780px; margin-inline: auto; }
  .sha-four-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Windows laptop / compact desktop */
@media (max-width: 1350px) {
  .sha-page-head { grid-template-columns: 1fr; align-items: start; gap: 12px; }
  .sha-head-actions { justify-content: flex-start; flex-wrap: wrap; }
  .sha-company-search { width: 240px; }
  .sha-nav-copy { width: 112px; min-width: 112px; }
  .sha-metrics { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .sha-four-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sha-large-deals-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sha-large-deals-table { min-width: 900px; }
}

/* Tablet / narrow app shell */
@media (max-width: 1024px) {
  .sha-head-actions { width: 100%; }
  .sha-company-search { flex: 1 1 250px; width: auto; max-width: 360px; }
  .sha-snapshot-nav { flex: 1 1 auto; max-width: 560px; }
  .sha-nav-center { min-width: 0; }
  .sha-nav-copy { flex: 1 1 105px; width: auto; min-width: 96px; }
  .sha-manage-head { align-items: flex-start; flex-direction: column; }
  .sha-manage-actions { width: 100%; justify-content: flex-start; }
  .sha-search-tools { grid-template-columns: 1fr; }
  .sha-search-category-menu { left: 0; right: auto; }
  .sha-search-result-row { grid-template-columns: minmax(0,1.5fr) 90px 85px 95px; }
  .sha-search-row-date { grid-column: 1 / -1; justify-self: start; }
}

/* Mobile profile: 384×832 baseline */
@media (max-width: 640px) {
  .sha-page-copy h1 { font-size: 27px; }
  .sha-page-copy p { font-size: var(--sha-font-sm); }
  .sha-head-actions { display: grid; grid-template-columns: minmax(0,1fr) 44px; gap: 8px; }
  .sha-company-search { grid-column: 1 / -1; width: 100%; max-width: none; }
  .sha-snapshot-nav { grid-column: 1 / -1; width: 100%; max-width: none; grid-template-columns: 36px minmax(0,1fr) 36px; }
  .sha-nav-center { min-width: 0; justify-content: space-between; padding: 5px 7px; }
  .sha-market-range { flex: 1 1 auto; }
  .sha-market-range-btn { --sha-range-pad-x: 7px; --sha-range-min-w: 32px; }
  .sha-nav-copy { min-width: 78px; width: 78px; flex: 0 0 78px; }
  .sha-weekly-pdf-btn { grid-column: 1 / -1; width: 100%; }
  .sha-manage-benpos-btn { grid-column: 1; width: 100%; }
  .sha-holding-search-btn { grid-column: 2; width: 44px; }

  .sha-metrics { grid-template-columns: 1fr 1fr; }
  .sha-metrics article { min-height: 60px; padding: 9px; }
  .sha-four-grid { grid-template-columns: 1fr; }
  .sha-history-modal-backdrop { padding: 6px; }
  .sha-history-modal {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
    max-height: calc(100vh - 12px);
    border-radius: 18px;
  }
  .sha-history-modal-head { min-height: 78px; padding-left: 12px; padding-right: 12px; }
  .sha-history-modal-body {
    grid-template-rows: auto 205px minmax(0,1fr);
    gap: 8px;
    padding: 10px 12px 12px;
  }
  .sha-history-modal-summary { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
  .sha-history-modal-stat { min-height: 52px; }
  .sha-history-modal-section-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .sha-history-modal-chart-metrics { justify-content: flex-start; }
  .sha-history-modal-chart-scroll { margin-inline: -2px; }
  .sha-history-modal-chart { height: 140px; }
  .sha-history-modal-table { min-width: 620px; }
  .sha-external-card .sha-external-table-wrap { flex-basis: auto; }
  .sha-card { padding: 10px; }
  .sha-market-card { padding: 10px; }
  .sha-market-smart-tip { min-width: 270px; max-width: calc(100vw - 24px); }
  .sha-market-deal-tip-row { grid-template-columns: 1fr; gap: 4px; }

  .sha-large-deals-summary { grid-template-columns: 1fr 1fr; }
  .sha-large-deals-foot { align-items: flex-start; flex-direction: column; }

  .sha-search-drawer { top: 6px; right: 6px; bottom: 6px; width: calc(100vw - 12px); }
  .sha-search-drawer-head { padding: 14px; }
  .sha-search-drawer-body { padding: 12px; }
  .sha-search-drawer-icon { width: 40px; height: 40px; flex-basis: 40px; }
  .sha-search-drawer-title h2 { font-size: 18px; }
  .sha-search-scope { align-items: flex-start; flex-direction: column; }
  .sha-search-scope small { text-align: left; }
  .sha-search-result-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .sha-search-investor-cell { grid-column: 1 / -1; }
  .sha-search-row-metric { padding: 7px; border: 1px solid #efedf3; border-radius: 9px; background: #fbfbfd; text-align: left; }
  .sha-search-row-date { grid-column: 1 / -1; }

  .sha-upload-modal { width: calc(100vw - 12px); max-height: calc(100vh - 12px); border-radius: 18px; }
  .sha-upload-head, .sha-upload-body, .sha-upload-footer { padding-left: 16px; padding-right: 16px; }
  :root { --sha-overlay-title-size: 18px; }
  .sha-file-slots, .sha-preview-grid { grid-template-columns: 1fr; }
  .sha-file-slots article { grid-template-columns: 36px minmax(0,1fr); }
  .sha-file-slots .slot-state { grid-column: 2; justify-self: start; }
  .sha-upload-footer { flex-direction: column; align-items: stretch; }
  .sha-upload-footer > div { width: 100%; }
  .sha-upload-footer .sha-secondary-btn, .sha-upload-footer .sha-upload-btn { flex: 1 1 auto; }
}

/* 14 — ACCESSIBILITY / MOTION */
.sha-page :is(button, input, select, [role="button"]):focus-visible {
  outline: 2px solid rgba(108,76,245,.75);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .sha-page *, .sha-page *::before, .sha-page *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* ==========================================================================
   V5 — HEADER COMPACT ACTIONS
   Keep the desktop header on one clean visual line and use icon-only utility
   actions for Weekly PDF, Manage Benpos and Shareholding Search.
   ========================================================================== */
@media (min-width: 1351px) {
  .sha-page-head {
    grid-template-columns: minmax(330px, 1fr) auto;
    align-items: center;
    gap: 16px;
  }

  .sha-head-actions { gap: 7px; }

  .sha-company-search {
    width: 220px;
    min-width: 190px;
  }

  .sha-snapshot-nav {
    grid-template-columns: 36px auto 36px;
    gap: 5px;
  }

  .sha-nav-arrow {
    width: 36px;
    min-height: 44px;
  }

  .sha-nav-center {
    gap: 6px;
    padding: 5px 7px;
  }

  .sha-market-range {
    --sha-range-height: 28px;
    --sha-range-min-w: 32px;
    --sha-range-pad-x: 7px;
  }

  .sha-nav-copy {
    width: 108px;
    min-width: 108px;
    padding-left: 2px;
    padding-right: 2px;
  }
}

.sha-head-icon-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.sha-head-icon-btn,
.sha-weekly-pdf-btn.sha-head-icon-btn,
.sha-email-pdf-btn.sha-head-icon-btn,
.sha-manage-benpos-btn.sha-head-icon-btn,
.sha-holding-search-btn.sha-head-icon-btn {
  position: relative;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 13px;
  white-space: normal;
}

.sha-head-icon-btn svg,
.sha-weekly-pdf-btn.sha-head-icon-btn svg,
.sha-email-pdf-btn.sha-head-icon-btn svg,
.sha-manage-benpos-btn.sha-head-icon-btn svg,
.sha-holding-search-btn.sha-head-icon-btn svg {
  width: 18px;
  height: 18px;
}

.sha-weekly-pdf-btn.sha-head-icon-btn,
.sha-email-pdf-btn.sha-head-icon-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #d8d0ff;
  background: #fbfaff;
  color: var(--sha-purple-strong);
  box-shadow: none;
}

.sha-weekly-pdf-btn.sha-head-icon-btn:hover,
.sha-email-pdf-btn.sha-head-icon-btn:hover {
  border-color: #cbbfff;
  background: var(--sha-purple-soft);
  color: var(--sha-purple-strong);
}

.sha-manage-benpos-btn.sha-head-icon-btn,
.sha-holding-search-btn.sha-head-icon-btn {
  background: #fff;
}

/* Small custom labels keep icon-only controls understandable without
   reintroducing width into the header. Native title attributes remain as a
   fallback for keyboard / browser tooltip behaviour. */
.sha-head-icon-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 180;
  top: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, -3px);
  padding: 6px 8px;
  border: 1px solid #e5e1f3;
  border-radius: 8px;
  background: #2f3142;
  color: #fff;
  box-shadow: 0 8px 22px rgba(34, 31, 54, .16);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}

.sha-head-icon-btn[data-tooltip]:hover::after,
.sha-head-icon-btn[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* Compact desktop / Windows laptop: keep the action cluster compact after the
   header wraps, instead of turning utility buttons back into wide text buttons. */
@media (max-width: 1350px) and (min-width: 641px) {
  .sha-head-actions {
    align-items: center;
    gap: 7px;
  }

  .sha-company-search {
    width: 225px;
    min-width: 190px;
  }

  .sha-snapshot-nav {
    flex: 0 1 auto;
    max-width: 620px;
  }

  .sha-head-icon-actions { margin-left: auto; }
}

@media (max-width: 640px) {
  .sha-head-actions {
    grid-template-columns: minmax(0,1fr) auto;
  }

  .sha-head-icon-actions {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .sha-weekly-pdf-btn.sha-head-icon-btn,
  .sha-email-pdf-btn.sha-head-icon-btn,
  .sha-manage-benpos-btn.sha-head-icon-btn,
  .sha-holding-search-btn.sha-head-icon-btn {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }

  /* Override the older full-width mobile button rules. */
  .sha-weekly-pdf-btn { grid-column: auto; width: 42px; }
  .sha-email-pdf-btn { grid-column: auto; width: 42px; }
  .sha-manage-benpos-btn { grid-column: auto; width: 42px; }
  .sha-holding-search-btn { grid-column: auto; width: 42px; }
}


/* 12 — EMAIL WEEKLY PDF */
body.sha-email-open { overflow: hidden; }
.sha-email-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1450;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(32,34,49,.38);
  backdrop-filter: blur(4px);
}
.sha-email-backdrop.hidden { display: none !important; }
.sha-email-modal {
  width: min(var(--sha-email-modal-width), calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--sha-border);
  border-radius: var(--sha-radius-xl);
  background: var(--sha-surface);
  box-shadow: var(--sha-shadow-lg);
}
.sha-email-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--sha-border);
  background: var(--sha-purple-surface);
}
.sha-email-title-wrap { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.sha-email-title-icon, .sha-email-preview-icon {
  width: var(--sha-email-icon-box);
  height: var(--sha-email-icon-box);
  flex: 0 0 var(--sha-email-icon-box);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--sha-purple-soft);
  color: var(--sha-purple);
}
.sha-email-title-icon svg, .sha-email-preview-icon svg { width: var(--sha-email-icon-glyph); height: var(--sha-email-icon-glyph); }
.sha-email-title-wrap > div > span { display:block; color:var(--sha-purple); font-size:var(--sha-overlay-label-size); font-weight:800; letter-spacing:.09em; }
.sha-email-head h2 { margin:4px 0 3px; color:var(--sha-ink); font-size:var(--sha-overlay-title-size); line-height:1.15; font-weight:var(--sha-overlay-title-weight); }
.sha-email-head p { margin:0; color:var(--sha-muted); font-size:var(--sha-overlay-subtitle-size); line-height:1.45; }
.sha-email-close {
  width: 36px; height: 36px; flex:0 0 36px; display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--sha-border); border-radius:11px; background:#fff; color:var(--sha-muted); cursor:pointer;
}
.sha-email-close:hover { color:var(--sha-purple); border-color:#cec6fb; background:#faf8ff; }
.sha-email-close svg { width:16px; height:16px; }
.sha-email-body { display:grid; gap:14px; padding:18px; }
.sha-email-field { display:grid; gap:7px; }
.sha-email-field > span { color:var(--sha-text); font-size:var(--sha-overlay-control-size); font-weight:700; }
.sha-email-input { position:relative; }
.sha-email-input > svg { position:absolute; left:12px; top:50%; width:15px; height:15px; color:var(--sha-purple); transform:translateY(-50%); pointer-events:none; }
.sha-email-input input {
  width:100%; height:var(--sha-email-control-h); padding:0 12px 0 38px; border:1px solid var(--sha-border); border-radius:11px;
  background:#fff; color:var(--sha-ink); font-size:var(--sha-overlay-body-size); outline:none;
}
.sha-email-input input:focus { border-color:#a99af9; box-shadow:0 0 0 3px rgba(108,76,245,.09); }
.sha-email-preview { display:flex; align-items:center; gap:11px; padding:12px; border:1px solid var(--sha-border); border-radius:12px; background:var(--sha-surface-soft); }
.sha-email-preview > div { min-width:0; }
.sha-email-preview strong { display:block; color:var(--sha-ink); font-size:var(--sha-overlay-body-size); font-weight:800; line-height:1.3; }
.sha-email-preview span:not(.sha-email-preview-icon) { display:block; margin-top:3px; color:var(--sha-muted); font-size:var(--sha-overlay-meta-size); line-height:1.4; }
.sha-email-alert { padding:10px 12px; border:1px solid transparent; border-radius:10px; font-size:var(--sha-overlay-body-size); line-height:1.4; font-weight:600; }
.sha-email-alert.is-info { border-color:#ded8ff; background:var(--sha-purple-surface); color:#5d50b7; }
.sha-email-alert.is-success { border-color:#cdebdc; background:#effaf5; color:#147453; }
.sha-email-alert.is-error { border-color:#f0d4da; background:#fff5f7; color:#a43a52; }
.sha-email-footer { display:flex; justify-content:flex-end; gap:9px; padding:0 18px 18px; }
.sha-email-cancel, .sha-email-send { height:var(--sha-email-action-h); display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:0 15px; border-radius:11px; font-size:var(--sha-overlay-control-size); font-weight:800; cursor:pointer; }
.sha-email-cancel { border:1px solid var(--sha-border); background:#fff; color:var(--sha-text); }
.sha-email-send { border:1px solid var(--sha-purple); background:var(--sha-purple); color:#fff; }
.sha-email-send svg { width:15px; height:15px; }
.sha-email-send:hover { background:var(--sha-purple-strong); border-color:var(--sha-purple-strong); }
.sha-email-send:disabled { opacity:.68; cursor:wait; }
.sha-email-send.is-success { background:#17815e; border-color:#17815e; }
