/* ============================================================
   Company Profile Component — "Precision Lithograph" Design
   All styles scoped under .cp-redesign to prevent leakage
   ============================================================ */

/* ---- Design Tokens as CSS Variables ---- */
.cp-redesign {
  --cp-primary: #005db5;
  --cp-primary-dim: #0052a0;
  --cp-primary-container: #d6e3ff;
  --cp-on-primary: #f6f7ff;
  --cp-on-primary-container: #00519e;
  --cp-secondary: #536073;
  --cp-secondary-container: #d6e3fb;
  --cp-on-secondary-container: #465365;
  --cp-tertiary: #5d5c78;
  --cp-tertiary-container: #d9d7f8;
  --cp-on-tertiary-container: #4a4a65;
  --cp-error: #9f403d;
  --cp-error-container: #fe8983;
  --cp-on-error-container: #752121;
  --cp-surface: #f8f9fa;
  --cp-surface-low: #f1f4f6;
  --cp-surface-container: #eaeff1;
  --cp-surface-high: #e2e9ec;
  --cp-surface-highest: #dbe4e7;
  --cp-surface-lowest: #ffffff;
  --cp-on-surface: #2b3437;
  --cp-on-surface-variant: #586064;
  --cp-outline: #737c7f;
  --cp-outline-variant: #abb3b7;
  --cp-shadow: 0 12px 32px -4px rgba(43, 52, 55, 0.08);
  --cp-font-headline: 'Manrope', sans-serif;
  --cp-font-body: 'Inter', sans-serif;

  font-family: var(--cp-font-body);
  color: var(--cp-on-surface);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Material Symbols baseline */
.cp-redesign .material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

/* ---- Shoelace Dialog Overrides ---- */
#company-details-dialog::part(panel) {
  height: 90vh;
  border-radius: 0.75rem;
  overflow: hidden;
}

#company-details-dialog::part(body) {
  padding: 0 !important;
  overflow: hidden !important;
  height: 100% !important;
}


#company-details-dialog::part(footer) {
  display: none;
}

#company-details-dialog::part(base) {
  z-index: 99999;
}

#company-details-dialog::part(overlay) {
  background-color: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
}

.sl-toast-stack {
  top: 60px !important;
  z-index: 999999 !important;
}

/* ---- Loader ---- */
.cp-redesign .cp-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
  z-index: 50;
}

/* ---- Header ---- */
.cp-redesign .cp-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248, 249, 250, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 1.5rem;
  border-bottom: 1px solid rgba(171, 179, 183, 0.1);
}

.cp-redesign .cp-header-left,
.cp-redesign .cp-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cp-redesign .cp-header-title {
  font-family: var(--cp-font-headline);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--cp-on-surface);
  margin: 0;
}

.cp-redesign .cp-header-title .cp-header-subtitle {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--cp-on-surface-variant);
}

.cp-redesign .cp-header-btn {
  background: none;
  border: none;
  color: var(--cp-outline-variant);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.375rem;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

.cp-redesign .cp-header-btn:hover {
  color: var(--cp-on-surface);
}

/* ---- Layout ---- */
.cp-redesign .cp-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ---- Sidebar Navigation ---- */
.cp-redesign .cp-sidebar {
  display: flex;
  flex-direction: column;
  width: 11rem;
  background-color: var(--cp-surface-low);
  padding: 1rem;
  gap: 0.25rem;
  overflow-y: auto;
  flex-shrink: 0;
}

.cp-redesign .cp-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cp-redesign .cp-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-family: var(--cp-font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--cp-on-surface-variant);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.cp-redesign .cp-nav-item:hover {
  background-color: var(--cp-surface-high);
  color: var(--cp-on-surface);
}

.cp-redesign .cp-nav-item.active {
  background-color: var(--cp-surface-lowest);
  color: var(--cp-primary);
  font-weight: 700;
  box-shadow: 0 2px 8px -2px rgba(43, 52, 55, 0.1);
  transform: translateX(2px);
}

.cp-redesign .cp-nav-item.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.cp-redesign .cp-nav-item .material-symbols-outlined {
  font-size: 20px;
}

/* ---- Content Area ---- */
.cp-redesign .cp-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background-color: var(--cp-surface-low);
  display: flex;
  flex-direction: column;
}

/* ---- Tab Panels ---- */
.cp-redesign .cp-tab-panel {
  display: none;
  padding: 1.5rem 2rem;
  padding-top: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.cp-redesign .cp-tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Financials and About tabs scroll freely (no table layout) */
.cp-redesign #cp-tab-financials.active,
.cp-redesign #cp-tab-overview.active {
  overflow-y: auto;
  overflow-x: hidden;
}

.cp-redesign #cp-tab-financials.active > *,
.cp-redesign #cp-tab-overview.active > * {
  flex-shrink: 0;
}

/* ---- Mobile Bottom Nav ---- */
.cp-redesign .cp-mobile-nav {
  display: none;
}

/* ---- Card Component ---- */
.cp-redesign .cp-card {
  background: var(--cp-surface-lowest);
  border-radius: 0.75rem;
  box-shadow: var(--cp-shadow);
  border: 1px solid rgba(171, 179, 183, 0.15);
  overflow: hidden;
}

.cp-redesign .cp-card-padded {
  padding: 1.25rem;
}

.cp-redesign .cp-metrics-grid .cp-card-padded {
  padding: 0.75rem 1.25rem;
}

/* ---- Page Header ---- */
.cp-redesign .cp-page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.cp-redesign .cp-page-title {
  font-family: var(--cp-font-headline);
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--cp-on-surface);
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem 0;
}

.cp-redesign .cp-page-title .cp-title-light {
  font-weight: 400;
  color: var(--cp-on-surface-variant);
  font-size: 1.25rem;
}

.cp-redesign .cp-page-desc {
  color: var(--cp-on-surface-variant);
  font-size: 0.8125rem;
  font-weight: 500;
  max-width: 42rem;
  margin: 0;
  line-height: 1.5;
}

.cp-redesign .cp-page-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ---- Metric Cards Grid ---- */
.cp-redesign .cp-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.cp-redesign .cp-metric-label {
  font-family: var(--cp-font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--cp-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  margin-top: 0;
}

.cp-redesign .cp-metric-value {
  font-family: var(--cp-font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cp-on-surface);
}

.cp-redesign .cp-metric-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--cp-on-surface-variant);
}

/* ---- Stat Badges (inline) ---- */
.cp-redesign .cp-stat-badge {
  text-align: center;
  padding: 0.5rem 1rem;
}

.cp-redesign .cp-stat-badge-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--cp-on-surface-variant);
  text-transform: uppercase;
}

.cp-redesign .cp-stat-badge-value {
  font-family: var(--cp-font-headline);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--cp-primary);
}

/* ---- Table Card (flex layout: scrollable body + sticky pagination) ---- */
.cp-redesign .cp-table-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.cp-redesign .cp-table-card .cp-table-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
}

.cp-redesign .cp-table-card .cp-pagination {
  flex-shrink: 0;
}

/* ---- Generic scroll area for non-table tabs ---- */
.cp-redesign .cp-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ---- Data Tables ---- */
.cp-redesign .cp-table-scroll {
  overflow-x: auto;
}

.cp-redesign .cp-table {
  font-family: var(--cp-font-body);
  font-size: 0.8125rem;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.cp-redesign .cp-table thead th {
  background-color: var(--cp-surface-high);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cp-on-surface-variant);
  padding: 0.75rem 1rem;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 5;
  cursor: pointer;
  white-space: nowrap;
  border: none;
}

.cp-redesign .cp-table tbody td {
  padding: 0.9rem 1rem;
  color: var(--cp-on-surface);
  vertical-align: top;
  border: none;
}

.cp-redesign .cp-table tbody tr:nth-child(odd) td {
  background-color: var(--cp-surface-lowest);
}

.cp-redesign .cp-table tbody tr:nth-child(even) td {
  background-color: var(--cp-surface);
}

.cp-redesign .cp-table tbody tr:hover td {
  background-color: var(--cp-surface-low);
}

/* Sort indicators */
.cp-redesign .cp-table th[sortable] {
  padding-right: 2rem;
}

.cp-redesign .cp-table th[sortable]::after {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  content: '⇅';
  opacity: 0.3;
  font-size: 0.75rem;
}

.cp-redesign .cp-table th[sortable].sort-asc::after {
  content: '↑'; opacity: 1; color: var(--cp-primary);
}

.cp-redesign .cp-table th[sortable].sort-desc::after {
  content: '↓'; opacity: 1; color: var(--cp-primary);
}

/* Cell helpers */
.cp-redesign .cp-cell-bold { font-weight: 600; }
.cp-redesign .cp-cell-sm { font-size: 0.8125rem; }
.cp-redesign .cp-cell-muted { color: var(--cp-on-surface-variant); }
.cp-redesign .cp-cell-nowrap { white-space: nowrap; }
.cp-redesign .cp-cell-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; display: block; }
.cp-redesign .cp-cell-link { color: var(--cp-on-surface); text-decoration: none; font-weight: 500; }
.cp-redesign .cp-cell-link:hover { color: var(--cp-primary); }

/* ---- Pagination ---- */
.cp-redesign .cp-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: var(--cp-surface-low);
  border-top: 1px solid rgba(171, 179, 183, 0.05);
}

.cp-redesign .cp-pagination-info {
  font-size: 0.75rem;
  color: var(--cp-on-surface-variant);
  font-weight: 500;
}

.cp-redesign .cp-pagination-buttons {
  display: flex;
  gap: 0.35rem;
}

.cp-redesign .cp-page-btn {
  height: 2rem;
  min-width: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: var(--cp-surface-lowest);
  border: 1px solid rgba(171, 179, 183, 0.2);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cp-on-surface-variant);
  cursor: pointer;
  transition: border-color 0.15s;
  padding: 0 0.5rem;
  font-family: var(--cp-font-body);
}

.cp-redesign .cp-page-btn:hover:not(:disabled) {
  border-color: var(--cp-primary);
}

.cp-redesign .cp-page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.cp-redesign .cp-page-btn.active {
  background: linear-gradient(135deg, var(--cp-primary), var(--cp-primary-dim));
  color: var(--cp-on-primary);
  border-color: transparent;
}

/* ---- Tags / Pills ---- */
.cp-redesign .cp-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: var(--cp-font-body);
  white-space: nowrap;
}

.cp-redesign .cp-tag-primary { background: var(--cp-primary-container); color: var(--cp-on-primary-container); }
.cp-redesign .cp-tag-secondary { background: var(--cp-secondary-container); color: var(--cp-on-secondary-container); }
.cp-redesign .cp-tag-tertiary { background: var(--cp-tertiary-container); color: var(--cp-on-tertiary-container); }
.cp-redesign .cp-tag-surface { background: var(--cp-surface-highest); color: var(--cp-on-surface-variant); }
.cp-redesign .cp-tag-error { background: var(--cp-error-container); color: var(--cp-on-error-container); }
.cp-redesign .cp-tag-success { background: #d1f5e0; color: #0a5c2c; }

.cp-redesign .cp-tag-truncate {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

.cp-redesign .cp-tags-row { display: flex; flex-wrap: wrap; gap: 0.25rem; }

/* ---- Layout Helpers ---- */
.cp-redesign .cp-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.cp-redesign .cp-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.cp-redesign .cp-grid-1-2 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.cp-redesign .cp-flex-row { display: flex; align-items: center; gap: 0.5rem; }
.cp-redesign .cp-flex-col { display: flex; flex-direction: column; }
.cp-redesign .cp-gap-sm { gap: 0.5rem; }
.cp-redesign .cp-gap-md { gap: 1rem; }
.cp-redesign .cp-gap-lg { gap: 1.5rem; }

/* ---- No Results State ---- */
.cp-redesign .cp-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 2rem;
  text-align: center;
  color: var(--cp-on-surface-variant);
  gap: 0.5rem;
}

.cp-redesign .cp-no-results .material-symbols-outlined {
  font-size: 40px;
  color: var(--cp-outline-variant);
}

.cp-redesign .cp-no-results-title {
  font-family: var(--cp-font-headline);
  font-weight: 700;
  font-size: 1rem;
}

.cp-redesign .cp-no-results-desc {
  font-size: 0.8125rem;
  color: var(--cp-outline);
}

/* ---- TradingView Containers ---- */
.cp-redesign .cp-tv-wrapper {
  position: relative;
  border-radius: 0.75rem;
}

.cp-redesign .tradingview-widget-container,
.cp-redesign .tradingview-widget-container__widget {
  height: calc(100% - 30px) !important;
  width: 100% !important;
}

.cp-redesign .tradingview-widget-copyright {
  font-size: 13px !important;
  line-height: 32px !important;
  text-align: center !important;
  color: #B2B5BE !important;
}

.cp-redesign .tradingview-skeleton {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--cp-surface-low) 25%, var(--cp-surface-high) 50%, var(--cp-surface-low) 75%);
  background-size: 200% 100%;
  animation: cp-shimmer 1.5s infinite;
  border-radius: 0.5rem;
  position: absolute;
  inset: 0;
  z-index: 0;
}

@keyframes cp-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Section Header (used inside cards) ---- */
.cp-redesign .cp-section-title {
  font-family: var(--cp-font-headline);
  font-weight: 700;
  color: var(--cp-on-surface);
  font-size: 0.9375rem;
  margin: 0 0 1rem 0;
}

.cp-redesign .cp-section-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--cp-surface-container);
}

.cp-redesign .cp-section-row:last-child {
  border-bottom: none;
}

.cp-redesign .cp-section-row-label {
  font-size: 0.8125rem;
  color: var(--cp-on-surface-variant);
  font-weight: 500;
}

.cp-redesign .cp-section-row-value {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--cp-on-surface);
}

/* ---- Placeholder block ---- */
.cp-redesign .cp-placeholder {
  background: var(--cp-surface-container);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cp-on-surface-variant);
  font-size: 0.8125rem;
  min-height: 10rem;
  gap: 0.5rem;
}

/* ---- Mineral Tags (Shoelace sl-tag) ---- */
.mineral-tag.au::part(base) { background-color: #FFD700; }
.mineral-tag.ag::part(base) { background-color: #C0C0C0; }
.mineral-tag.cu::part(base) { background-color: #B87333; color: white; }
.mineral-tag.pb::part(base) { background-color: #6C6C6A; color: white; }
.mineral-tag.zn::part(base) { background-color: #BAC4C8; }
.mineral-tag.mo::part(base) { background-color: #515D6D; color: white; }
.mineral-tag.pt::part(base) { background-color: #E5E4E2; }
.mineral-tag.pd::part(base) { background-color: #B0B0B0; }
.mineral-tag.ni::part(base) { background-color: #727472; color: white; }
.mineral-tag.sn::part(base) { background-color: #D3D4D5; }
.mineral-tag.bi::part(base) { background-color: #F4F3F2; }
.mineral-tag.cd::part(base) { background-color: #D22B2B; color: white; }
.mineral-tag.li2o::part(base) { background-color: #BFC4C8; }
.mineral-tag.li::part(base) { background-color: #B5CDC0; }
.mineral-tag.rees::part(base) { background-color: #C1AA6F; }
.mineral-tag.treo::part(base) { background-color: #C1AA6F; }
.mineral-tag.graphite::part(base) { background-color: #aeb3bd; color: white; }
.mineral-tag.graphitic-carbon::part(base) { background-color: #aeb3bd; color: white; }
.mineral-tag.sb::part(base) { background-color: #aeb3bd; color: white; }
.mineral-tag.co::part(base) { background-color: #3B3838; color: white; }
.mineral-tag.u::part(base) { background-color: #affb9e; }
.mineral-tag.u3o8::part(base) { background-color: #affb9e; }
.mineral-tag.hydrogen::part(base) { background-color: #339bd6; color: white; }

/* ---- Mineral Chips (Drilling tab) ---- */
.cp-redesign .cp-minerals-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.cp-redesign .cp-mineral-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-family: var(--cp-font-body);
  background: var(--cp-surface-high);
  color: var(--cp-on-surface);
  line-height: 1.3;
  white-space: nowrap;
}

.cp-redesign .cp-mineral-sym {
  font-weight: 700;
  color: var(--cp-primary);
}

.cp-redesign .cp-mineral-val {
  font-weight: 500;
}

.cp-redesign .cp-mineral-eqv {
  font-size: 0.625rem;
  color: var(--cp-on-surface-variant);
  margin-left: 0.15rem;
}

/* ---- About Tab (editor content) ---- */
.cp-redesign .cp-about-content {
  font-family: var(--cp-font-body);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--cp-on-surface);
  overflow-y: auto;
}

.cp-redesign .cp-about-content h1,
.cp-redesign .cp-about-content h2,
.cp-redesign .cp-about-content h3,
.cp-redesign .cp-about-content h4 {
  font-family: var(--cp-font-headline);
  color: var(--cp-on-surface);
  margin: 1.25rem 0 0.5rem 0;
}

.cp-redesign .cp-about-content h1 { font-size: 1.5rem; }
.cp-redesign .cp-about-content h2 { font-size: 1.25rem; }
.cp-redesign .cp-about-content h3 { font-size: 1.1rem; }
.cp-redesign .cp-about-content h4 { font-size: 0.95rem; }

.cp-redesign .cp-about-content p {
  margin: 0.5rem 0;
}

.cp-redesign .cp-about-content a {
  color: var(--cp-primary);
  text-decoration: none;
}

.cp-redesign .cp-about-content a:hover {
  text-decoration: underline;
}

.cp-redesign .cp-about-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
}

.cp-redesign .cp-about-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin: 0.75rem 0;
}

.cp-redesign .cp-about-content table th,
.cp-redesign .cp-about-content table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--cp-surface-container);
}

.cp-redesign .cp-about-content table th {
  background: var(--cp-surface-high);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--cp-on-surface-variant);
}

.cp-redesign .cp-about-content ul,
.cp-redesign .cp-about-content ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.cp-redesign .cp-about-content li {
  margin-bottom: 0.25rem;
}

/* ---- Overview Tab ---- */
.cp-redesign .cp-overview-activity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cp-redesign .cp-overview-activity-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--cp-surface-low);
  border-radius: 0.5rem;
}

.cp-redesign .cp-overview-activity-top {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cp-redesign .cp-overview-activity-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.cp-redesign .cp-overview-activity-card .cp-overview-link {
  margin-top: 0.5rem;
}

/* Sparkline mini bar chart */
.cp-redesign .cp-spark-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 36px;
  margin: 0.3rem 0 0 0;
}

.cp-redesign .cp-spark-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}

.cp-redesign .cp-spark-bar {
  width: 100%;
  background: var(--cp-primary);
  border-radius: 2px 2px 0 0;
  opacity: 0.7;
  transition: opacity 0.15s;
  margin-top: auto;
}

.cp-redesign .cp-spark-bar:hover {
  opacity: 1;
}

.cp-redesign .cp-spark-label {
  font-size: 0.5rem;
  color: var(--cp-on-surface-variant);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Mini horizontal bars (project commodity breakdown in activity card) */
.cp-redesign .cp-mini-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 0.4rem;
}

.cp-redesign .cp-mini-bar-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cp-redesign .cp-mini-bar-label {
  font-size: 0.55rem;
  font-weight: 500;
  color: var(--cp-on-surface-variant);
  width: 3rem;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-redesign .cp-mini-bar-track {
  flex: 1;
  height: 6px;
  background: var(--cp-surface-container);
  border-radius: 3px;
  overflow: hidden;
}

.cp-redesign .cp-mini-bar-fill {
  height: 100%;
  background: var(--cp-primary);
  border-radius: 3px;
  opacity: 0.7;
}

.cp-redesign .cp-mini-bar-count {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--cp-on-surface);
  min-width: 1rem;
  text-align: right;
}

@media (max-width: 767px) {
  .cp-redesign .cp-overview-activity-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Social Links ---- */
.cp-redesign .cp-social-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cp-redesign .cp-social-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  color: var(--cp-on-surface);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background-color 0.15s;
}

.cp-redesign .cp-social-link:hover {
  background-color: var(--cp-surface-low);
  color: var(--cp-primary);
}

.cp-redesign .cp-social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 0.375rem;
  background: var(--cp-surface-high);
  color: var(--cp-on-surface-variant);
  flex-shrink: 0;
}

.cp-redesign .cp-social-icon .material-symbols-outlined {
  font-size: 18px;
}

.cp-redesign .cp-social-link:hover .cp-social-icon {
  background: var(--cp-primary-container);
  color: var(--cp-on-primary-container);
}

/* ---- Performance Badges ---- */
.cp-redesign .cp-perf-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cp-redesign .cp-perf-item {
  flex: 1;
  min-width: 70px;
  text-align: center;
  padding: 0.5rem 0.25rem;
  border-radius: 0.375rem;
}

.cp-redesign .cp-perf-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cp-on-surface-variant);
  margin-bottom: 0.2rem;
}

.cp-redesign .cp-perf-value {
  font-family: var(--cp-font-headline);
  font-size: 0.875rem;
  font-weight: 700;
}

.cp-redesign .cp-perf-up {
  background: rgba(10, 92, 44, 0.08);
}

.cp-redesign .cp-perf-up .cp-perf-value {
  color: #0a5c2c;
}

.cp-redesign .cp-perf-down {
  background: rgba(159, 64, 61, 0.08);
}

.cp-redesign .cp-perf-down .cp-perf-value {
  color: var(--cp-error);
}

.cp-redesign .cp-perf-neutral {
  background: var(--cp-surface-high);
}

.cp-redesign .cp-perf-neutral .cp-perf-value {
  color: var(--cp-on-surface-variant);
}

/* ---- Color utilities ---- */
.cp-redesign .cp-positive { color: #0a5c2c; }
.cp-redesign .cp-negative { color: var(--cp-error); }
.cp-redesign .cp-link-primary { color: var(--cp-primary); cursor: pointer; text-decoration: none; font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---- Project Boundary Icon ---- */
.cp-redesign .cp-project-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cp-redesign .cp-project-icon svg {
  width: 28px !important;
  height: 28px !important;
}

.cp-redesign .cp-project-icon svg path,
.cp-redesign .cp-project-icon svg polygon,
.cp-redesign .cp-project-icon svg circle {
  fill: var(--cp-primary);
  fill-opacity: 0.25;
  stroke: var(--cp-primary);
  stroke-width: 1.5;
}

/* ---- Asset Map ---- */
.cp-redesign .cp-asset-map {
  height: 220px;
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--cp-surface-container);
}

.cp-redesign .cp-asset-map .leaflet-control-zoom {
  border: none;
  box-shadow: var(--cp-shadow);
}

.cp-redesign .cp-asset-map .leaflet-control-zoom a {
  width: 28px;
  height: 28px;
  line-height: 28px;
  font-size: 14px;
  color: var(--cp-on-surface);
  background: var(--cp-surface-lowest);
}

.cp-redesign .cp-map-fit-btn {
  margin-top: 0;
  border: 0;
  border-top: 1px solid #ccc;
  border-radius: 0;
}

.cp-redesign .cp-map-fit-btn a {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 28px !important;
  height: 28px !important;
  background: var(--cp-surface-lowest) !important;
  color: var(--cp-on-surface) !important;
  text-decoration: none !important;
}

.cp-redesign .cp-map-pin {
  background: none !important;
  border: none !important;
}

.cp-map-tooltip {
  font-family: 'Inter', sans-serif !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: #2b3437 !important;
  padding: 0.4rem 0.65rem !important;
  border-radius: 0.375rem !important;
  border: none !important;
  background: #ffffff !important;
  box-shadow: 0 4px 16px -2px rgba(43, 52, 55, 0.14) !important;
  line-height: 1.3 !important;
  letter-spacing: -0.01em;
}

.cp-map-tooltip::before {
  border-top-color: #ffffff !important;
}

/* ---- Project location: inline on mobile, separate column on desktop ---- */
.cp-redesign .cp-project-location-inline {
  display: none;
}

/* ---- Radio Button Group ---- */
.cp-redesign .cp-radio-group {
  display: flex;
  gap: 0;
  background: var(--cp-surface-high);
  border-radius: 0.5rem;
  padding: 0.2rem;
  width: fit-content;
  flex-shrink: 0;
}

.cp-redesign .cp-radio-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--cp-font-body);
  color: var(--cp-on-surface-variant);
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cp-redesign .cp-radio-btn:hover {
  color: var(--cp-on-surface);
}

.cp-redesign .cp-radio-btn.active {
  background: var(--cp-surface-lowest);
  color: var(--cp-primary);
  box-shadow: 0 1px 3px rgba(43, 52, 55, 0.1);
}

/* ---- Bar Charts (Metrics panel) ---- */
.cp-redesign .cp-metrics-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cp-redesign .cp-metrics-chart-area {
  max-height: 180px;
  padding-right: 10px;
  overflow-y: auto;
}

.cp-redesign .cp-metrics-tab-bar {
  display: flex;
  gap: 0;
  background: var(--cp-surface-high);
  border-radius: 0.375rem;
  padding: 0.15rem;
}

.cp-redesign .cp-metrics-tab-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: var(--cp-font-body);
  color: var(--cp-on-surface-variant);
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cp-redesign .cp-metrics-tab-btn:hover {
  color: var(--cp-on-surface);
}

.cp-redesign .cp-metrics-tab-btn.active {
  background: var(--cp-surface-lowest);
  color: var(--cp-primary);
  box-shadow: 0 1px 2px rgba(43, 52, 55, 0.08);
}

.cp-redesign .cp-metrics-chart {
  display: none;
}

.cp-redesign .cp-metrics-chart.active {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cp-redesign .cp-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.cp-redesign .cp-bar-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--cp-on-surface-variant);
  width: 6.5rem;
  min-width: 6.5rem;
  max-width: 6.5rem;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-redesign .cp-bar-track {
  flex: 1;
  height: 1.1rem;
  background: var(--cp-surface-container);
  border-radius: 0.25rem;
  overflow: hidden;
}

.cp-redesign .cp-bar-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--cp-primary), var(--cp-primary-dim));
  border-radius: 0.25rem;
  min-width: 2px;
  transition: width 0.3s ease;
}

.cp-redesign .cp-bar-count {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--cp-on-surface);
  min-width: 1.5rem;
  text-align: right;
}

/* ---- Filter Panel (slide-in from right) ---- */
.cp-redesign .cp-filter-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.cp-redesign .cp-filter-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cp-redesign .cp-filter-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  max-width: 90%;
  background: var(--cp-surface-lowest);
  box-shadow: -4px 0 24px rgba(43, 52, 55, 0.12);
  z-index: 31;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cp-redesign .cp-filter-panel.open {
  transform: translateX(0);
}

.cp-redesign .cp-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--cp-surface-container);
  flex-shrink: 0;
}

.cp-redesign .cp-filter-header h3 {
  font-family: var(--cp-font-headline);
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
}

.cp-redesign .cp-filter-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cp-redesign .cp-filter-section label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cp-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.cp-redesign .cp-filter-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-family: var(--cp-font-body);
  border: 1px solid var(--cp-outline-variant);
  border-radius: 0.375rem;
  background: var(--cp-surface-lowest);
  color: var(--cp-on-surface);
  box-sizing: border-box;
  height: 2.25rem;
}

.cp-redesign .cp-filter-input:focus {
  outline: none;
  border-color: var(--cp-primary);
  box-shadow: 0 0 0 2px rgba(0, 93, 181, 0.15);
}

.cp-redesign .cp-filter-input::placeholder {
  color: var(--cp-outline-variant);
}

/* Shared focus ring for all filter controls */
.cp-redesign .cp-filter-body *:focus-visible {
  outline: 2px solid var(--cp-primary);
  outline-offset: 1px;
  border-radius: 0.375rem;
}

.cp-redesign .cp-filter-footer sl-button:focus-visible::part(base) {
  outline: 2px solid var(--cp-primary);
  outline-offset: 2px;
}

.cp-redesign .cp-filter-header button:focus-visible {
  outline: 2px solid var(--cp-primary);
  outline-offset: 2px;
  border-radius: 0.375rem;
}

.cp-redesign .cp-filter-footer {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--cp-surface-container);
  flex-shrink: 0;
}

.cp-redesign .cp-filter-footer sl-button {
  flex: 1;
}

/* Date range row */
.cp-redesign .cp-filter-date-row {
  display: flex;
  gap: 0.5rem;
}

.cp-redesign .cp-filter-date-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cp-redesign .cp-filter-date-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--cp-on-surface-variant);
}

/* Multiselect widget overrides inside filter panel */
.cp-redesign .cp-filter-body .multiselect-widget {
  width: 100%;
  font-family: var(--cp-font-body);
}

.cp-redesign .cp-filter-body .multiselect-widget > summary {
  padding: 0.5rem 0.75rem !important;
  font-size: 0.8125rem !important;
  font-family: var(--cp-font-body) !important;
  border: 1px solid var(--cp-outline-variant) !important;
  border-radius: 0.375rem !important;
  background: var(--cp-surface-lowest) !important;
  color: var(--cp-on-surface) !important;
  cursor: pointer;
  list-style: none;
  height: 2.25rem !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  box-shadow: none !important;
}

.cp-redesign .cp-filter-body .multiselect-widget > summary::-webkit-details-marker {
  display: none;
}

.cp-redesign .cp-filter-body .multiselect-widget[open] > summary {
  border-color: var(--cp-primary) !important;
  box-shadow: 0 0 0 2px rgba(0, 93, 181, 0.15);
  border-radius: 0.375rem 0.375rem 0 0 !important;
}

.cp-redesign .cp-filter-body .multiselect-widget-category-header {
  font-size: 0.6875rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  color: var(--cp-on-surface-variant) !important;
  padding: 0.5rem 0.5rem 0.25rem !important;
  background-color: var(--cp-surface-low) !important;
  border-radius: 0.25rem;
  margin-top: 0.25rem;
}

.cp-redesign .cp-filter-body .multiselect-widget-item {
  padding: 0.3rem 0.5rem !important;
  font-size: 0.8125rem !important;
  font-weight: 400 !important;
  text-transform: none !important;
}

.cp-redesign .cp-filter-body .multiselect-widget-item-value {
  font-size: 0.8125rem !important;
  font-weight: 400 !important;
  text-transform: none !important;
  color: var(--cp-on-surface) !important;
}

.cp-redesign .cp-filter-body .multiselect-widget ul {
  border: 1px solid var(--cp-outline-variant);
  border-top: none;
  border-radius: 0 0 0.375rem 0.375rem;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
}

.cp-redesign .cp-filter-body .multiselect-widget li {
  list-style: none;
}

/* ---- Responsive ---- */
@media (min-width: 768px) {
  .cp-redesign .cp-metrics-grid { grid-template-columns: repeat(4, 1fr); }
  .cp-redesign .cp-grid-1-2 { grid-template-columns: 2fr 1fr; }
  .cp-redesign .cp-tab-panel { padding: 1rem; }
}

@media (max-width: 767px) {
  /* Dialog: full screen on mobile, above everything */
  #company-details-dialog::part(overlay) {
    background: none;
  }

  #company-details-dialog::part(panel) {
    min-height: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
    margin: 0;
    max-width: 100%;
    width: 100%;
  }

  #company-details-dialog::part(base) {
    padding: 0;
    position: fixed;
    inset: 0;
    z-index: 999999;
  }

  /* Sidebar hidden, mobile nav shown */
  .cp-redesign .cp-sidebar { display: none; }

  .cp-redesign .cp-mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fafafa;
    border-top: 1px solid #e2e6ea;
    justify-content: space-around;
    padding: 0.4rem 0.15rem;
    z-index: 50;
  }

  .cp-redesign .cp-mobile-nav-item {
    font-size: 0.55rem;
    padding: 0.15rem 0.25rem;
  }

  .cp-redesign .cp-mobile-nav-item .material-symbols-outlined {
    font-size: 20px;
  }

  /* Content area: account for bottom nav */
  .cp-redesign .cp-content {
    padding-bottom: 56px;
  }

  /* Tab panels: smaller padding on mobile */
  .cp-redesign .cp-tab-panel {
    padding: 0.75rem !important;
  }

  /* Page header: stack vertically, smaller title */
  .cp-redesign .cp-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .cp-redesign .cp-page-title {
    font-size: 1.25rem;
  }

  .cp-redesign .cp-page-desc {
    font-size: 0.75rem;
  }

  /* Metric cards: 2 columns on mobile */
  .cp-redesign .cp-metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem;
  }

  .cp-redesign .cp-metric-value {
    font-size: 1.1rem;
  }

  /* 2-column grids: stack to 1 column */
  .cp-redesign .cp-grid-2 {
    grid-template-columns: 1fr !important;
  }

  /* 2:1 grids: stack to 1 column */
  .cp-redesign .cp-grid-1-2 {
    grid-template-columns: 1fr !important;
  }

  /* Activity pulse: 2 columns */
  .cp-redesign .cp-overview-activity-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem;
  }

  /* Tables: enable horizontal scroll, reduce padding */
  .cp-redesign .cp-table thead th {
    padding: 0.5rem 0.5rem;
    font-size: 0.6rem;
  }

  .cp-redesign .cp-table tbody td {
    padding: 0.6rem 0.5rem;
    font-size: 0.75rem;
  }

  /* Table card: let it take available space without forcing overflow */
  .cp-redesign .cp-table-card {
    min-height: 200px;
  }

  /* Stat badges: smaller on mobile */
  .cp-redesign .cp-stat-badge {
    padding: 0.35rem 0.5rem;
  }

  .cp-redesign .cp-stat-badge-value {
    font-size: 0.9rem;
  }

  /* Radio group: wrap and smaller */
  .cp-redesign .cp-radio-group {
    flex-wrap: wrap;
  }

  .cp-redesign .cp-radio-btn {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
  }

  /* Section titles smaller */
  .cp-redesign .cp-section-title {
    font-size: 0.85rem;
  }

  /* Section rows: allow wrapping for long values */
  .cp-redesign .cp-section-row {
    flex-wrap: wrap;
    gap: 0.15rem;
  }

  .cp-redesign .cp-section-row-value {
    font-size: 0.75rem;
    word-break: break-word;
  }

  /* Tags: smaller */
  .cp-redesign .cp-tag {
    font-size: 0.6rem;
    padding: 0.1rem 0.35rem;
  }

  /* Performance badges: wrap, smaller */
  .cp-redesign .cp-perf-row {
    gap: 0.3rem;
  }

  .cp-redesign .cp-perf-item {
    min-width: 55px;
    padding: 0.35rem 0.15rem;
  }

  .cp-redesign .cp-perf-value {
    font-size: 0.75rem;
  }

  /* Pagination: stack on very small screens */
  .cp-redesign .cp-pagination {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .cp-redesign .cp-pagination-info {
    font-size: 0.65rem;
  }

  /* Filter panel: full width on mobile */
  .cp-redesign .cp-filter-panel {
    width: 100%;
    max-width: 100%;
  }

  /* Bar charts: narrower labels */
  .cp-redesign .cp-bar-label {
    width: 5rem;
    min-width: 5rem;
    max-width: 5rem;
    font-size: 0.6rem;
  }

  /* Metrics tabs: smaller buttons */
  .cp-redesign .cp-metrics-tab-btn {
    font-size: 0.6rem;
    padding: 0.2rem 0.4rem;
  }

  /* Asset map: shorter on mobile */
  .cp-redesign .cp-asset-map {
    height: 180px;
  }

  /* On mobile, all tabs scroll their content freely (no fixed table layout) */
  .cp-redesign .cp-tab-panel.active {
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .cp-redesign .cp-tab-panel.active > * {
    flex-shrink: 0;
  }

  /* Table cards don't need flex:1 on mobile — they size to content */
  .cp-redesign .cp-table-card {
    flex: none !important;
  }

  /* Social links: 2 columns on mobile */
  .cp-redesign .cp-social-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
  }

  /* SEDAR: pagination and category adjustments */
  .cp-redesign .sedar-filings-filter-bar {
    flex-wrap: wrap;
  }

  /* Financials: chart smaller */
  .cp-redesign .cp-tv-wrapper {
    height: 300px !important;
  }

  /* ---- Mobile Card Layout for Tables ---- */
  .cp-redesign .cp-table {
    display: block;
  }

  .cp-redesign .cp-table thead {
    display: none;
  }

  .cp-redesign .cp-table tbody {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .cp-redesign .cp-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--cp-surface-lowest);
    border-radius: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(43, 52, 55, 0.06);
    border: 1px solid rgba(171, 179, 183, 0.1);
    gap: 0.2rem 0.75rem;
  }

  .cp-redesign .cp-table tbody tr td {
    display: flex;
    flex-direction: column;
    padding: 0.1rem 0 !important;
    background: none !important;
    font-size: 0.8125rem;
  }

  /* Label above value */
  .cp-redesign .cp-table tbody tr td[data-label]::before {
    content: attr(data-label);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--cp-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .cp-redesign .cp-table tbody tr td[data-label=""]::before {
    display: none;
  }

  /* Full-width cells span both columns */
  .cp-redesign .cp-table tbody tr td.cp-mobile-full {
    grid-column: 1 / -1;
  }

  /* ---- Projects: icon left, details right ---- */
  #cp-tab-projects .cp-table tbody tr {
    grid-template-columns: 44px 1fr 1fr;
  }

  #cp-tab-projects .cp-table tbody tr .cp-project-icon-cell {
    grid-row: 1 / 4;
    align-items: center;
    justify-content: center;
  }

  #cp-tab-projects .cp-table tbody tr .cp-project-icon-cell .cp-project-icon {
    width: 36px;
    height: 36px;
  }

  #cp-tab-projects .cp-table tbody tr .cp-project-icon-cell .cp-project-icon svg {
    width: 36px !important;
    height: 36px !important;
  }

  /* Project name + location spans full remaining width */
  #cp-tab-projects .cp-table tbody tr .cp-project-name-cell {
    grid-column: 2 / -1;
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
  }

  /* Show inline location, hide separate location cell on mobile */
  #cp-tab-projects .cp-project-location-inline {
    display: inline !important;
    font-weight: 400;
    font-size: 0.7rem;
    color: var(--cp-on-surface-variant);
    margin-left: 0.4rem;
  }

  #cp-tab-projects .cp-project-location-cell {
    display: none !important;
  }

  /* Commodities stays in the grid (no full-width span) */

  /* ---- News: headline at top, details below in 2 cols ---- */
  #cp-tab-news .cp-table tbody tr .cp-news-headline {
    order: -1;
    grid-column: 1 / -1;
    padding-bottom: 0.3rem !important;
    margin-bottom: 0.1rem;
    border-bottom: 1px solid rgba(171, 179, 183, 0.1);
    font-size: 0.875rem;
  }

  #cp-tab-news .cp-table tbody tr .cp-news-tags {
    grid-column: 1 / -1;
  }

  /* ---- Drilling: headline promoted to top ---- */
  #cp-tab-drilling .cp-table tbody tr .cp-drill-headline {
    order: -1;
    grid-column: 1 / -1;
    color: var(--cp-on-surface-variant);
    font-size: 0.75rem;
    line-height: 1.4;
    padding-bottom: 0.3rem !important;
    margin-bottom: 0.1rem;
    border-bottom: 1px solid rgba(171, 179, 183, 0.1);
  }

  /* Minerals row full width */
  #cp-tab-drilling .cp-table tbody tr td:last-child {
    grid-column: 1 / -1;
  }

  /* ---- Insiders: 2-col grid, name promoted to card header ---- */
  #cp-tab-insiders .cp-table tbody tr {
    grid-template-columns: 1fr 1fr;
  }

  /* Reorder: name first (it's the 2nd td in DOM) */
  #cp-tab-insiders .cp-table tbody tr td:nth-child(1) { order: 2; } /* date */
  #cp-tab-insiders .cp-table tbody tr .cp-insider-name {
    order: 1;
    grid-column: 1 / -1;
    padding-bottom: 0.35rem !important;
    margin-bottom: 0.15rem;
    border-bottom: 1px solid rgba(171, 179, 183, 0.1);
  }
  #cp-tab-insiders .cp-table tbody tr td:nth-child(3) { order: 3; } /* type */
  #cp-tab-insiders .cp-table tbody tr td:nth-child(4) { order: 4; } /* security */
  #cp-tab-insiders .cp-table tbody tr td:nth-child(5) { order: 5; } /* transaction */
  #cp-tab-insiders .cp-table tbody tr td:nth-child(6) { order: 6; } /* holdings */

  /* Header: ensure it's visible and not cut off */
  .cp-redesign .cp-header {
    padding: 0.5rem 0.75rem;
    position: relative;
    z-index: 40;
  }

  .cp-redesign .cp-header-title {
    font-size: 0.85rem;
  }
}

/* ---- Mobile Nav Items ---- */
.cp-redesign .cp-mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--cp-font-body);
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--cp-on-surface-variant);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s;
}

.cp-redesign .cp-mobile-nav-item .material-symbols-outlined {
  font-size: 22px;
}

.cp-redesign .cp-mobile-nav-item.active {
  color: var(--cp-primary);
  font-weight: 700;
}

.cp-redesign .cp-mobile-nav-item.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
