/* ═══════════════════════════════════════════════
   Stocks Detail — Beautiful Frontend  •  detail.css
   Theme: violet primary #7c3aed
   ═══════════════════════════════════════════════ */

.stock-main { flex: 1; min-width: 0; max-width: none; width: auto; }
.layout-container:has(.stock-main) { align-items: flex-start; }
/* detail uses full width like cards detail — no sidebar constraint */
.stock-main .detail-hero,
.stock-main .stock-tabs,
.stock-main .detail-card { max-width: none; width: 100%; }

/* two-column detail layout — uses right space like cards detail */
.stock-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
  gap: 1rem;
  align-items: start;
}
.stock-detail-grid > .detail-card { margin-bottom: 1rem; }
@media (max-width: 1024px) {
  .stock-detail-grid { grid-template-columns: 1fr; }
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--foreground-light);
  margin-bottom: 1rem;
}
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--foreground-light);
  text-decoration: none;
  font-weight: 500;
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb a svg { width: 0.875rem; height: 0.875rem; }
.crumb-sep { opacity: 0.5; }
.crumb-current { color: var(--foreground); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Hero ── */
.detail-hero {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.detail-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(500px 300px at 90% 0%, rgba(124,58,237,0.12), transparent 60%),
    linear-gradient(135deg, #faf5ff 0%, #ffffff 60%);
  pointer-events: none;
}
.detail-hero-inner {
  position: relative;
  display: flex;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1.25rem;
  align-items: flex-start;
}
.detail-avatar {
  width: 3.25rem; height: 3.25rem;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(124,58,237,0.30);
}
.detail-hero-copy { min-width: 0; flex: 1; }
.detail-hero-copy h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.pill-symbol { background: var(--primary); color: #fff; border-color: var(--primary); }
.pill-symbol svg { color: #fff !important; }
.pill-accent { background: rgba(124,58,237,0.10); border-color: rgba(124,58,237,0.18); color: var(--primary); }
.pill-light { background: #fff; }
.pill svg { width: 0.8125rem; height: 0.8125rem; color: var(--primary); }
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  background: rgba(124,58,237,0.08);
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
}
.hero-links a:hover { background: rgba(124,58,237,0.14); }
.hero-links a svg { width: 0.8125rem; height: 0.8125rem; }

.detail-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 0 1.5rem 1.25rem;
}
@media (max-width: 768px) { .detail-stats { grid-template-columns: repeat(2, 1fr); } }
.d-stat {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.d-stat-highlight {
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border-color: rgba(124,58,237,0.18);
}
.d-stat-icon {
  width: 1.5rem; height: 1.5rem;
  border-radius: 0.375rem;
  display: grid; place-items: center;
  background: #fff;
  border: 1px solid var(--border);
}
.d-stat-highlight .d-stat-icon { background: var(--primary); border-color: var(--primary); color: #fff; }
.d-stat-icon svg { width: 0.875rem; height: 0.875rem; color: var(--primary); }
.d-stat-highlight .d-stat-icon svg { color: #fff; }
.d-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--foreground-light);
}
.d-stat-val {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

/* ── Sticky tabs ── */
.stock-tabs {
  position: sticky;
  top: 56px;
  z-index: 5;
  display: flex;
  gap: 0.25rem;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.25rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.stock-tabs::-webkit-scrollbar { display: none; }
.tab-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground-light);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.tab-link svg { width: 0.9375rem; height: 0.9375rem; }
.tab-link:hover { background: rgba(124,58,237,0.08); color: var(--foreground); }
.tab-link.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(124,58,237,0.25); }

/* ── Detail cards ── */
.detail-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.875rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  scroll-margin-top: 120px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  margin-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
}
.section-heading h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.icon-bubble {
  width: 1.75rem; height: 1.75rem;
  border-radius: 0.5rem;
  display: grid; place-items: center;
  background: rgba(124,58,237,0.10);
  flex-shrink: 0;
}
.icon-bubble svg { width: 0.9375rem; height: 0.9375rem; color: var(--primary); }
.muted-note {
  font-size: 0.75rem;
  color: var(--foreground-light);
  font-weight: 500;
}
.section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.section-link:hover { text-decoration: underline; }
.section-link svg { width: 0.8125rem; height: 0.8125rem; }
.about-text {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--foreground);
  margin: 0;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 1.75rem 1rem;
  color: var(--foreground-light);
}
.empty-state svg { width: 2rem; height: 2rem; margin-bottom: 0.5rem; opacity: 0.6; }
.empty-state p { font-size: 0.875rem; font-weight: 600; margin: 0; color: var(--foreground); }
.empty-hint { font-size: 0.75rem; margin-top: 0.25rem; display: block; }
.stocks-detail-empty {
  max-width: 560px;
  margin: 3rem auto;
  text-align: center;
  padding: 2rem;
}
.empty-illustration svg { width: 3rem; height: 3rem; color: var(--foreground-light); opacity: 0.5; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--primary);
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 1rem;
}
.btn-primary:hover { background: #6d28d9; }
.btn-primary svg { width: 0.9375rem; height: 0.9375rem; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; margin: 0 -0.25rem; padding: 0 0.25rem; }
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8125rem;
  white-space: nowrap;
}
.data-table th,
.data-table td {
  padding: 0.625rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.data-table th:first-child,
.data-table td:first-child { text-align: left; }
.data-table thead th {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--foreground-light);
  background: #f9fafb;
  position: sticky;
  top: 0;
}
.data-table thead th:first-child { border-radius: 0.5rem 0 0 0; }
.data-table thead th:last-child { border-radius: 0 0.5rem 0 0; }
.quarters-table td.latest,
.quarters-table th.latest {
  background: #f5f3ff;
  font-weight: 700;
  color: var(--primary);
}
.quarters-table td.row-head {
  font-weight: 600;
  color: var(--foreground);
  background: #fff;
  position: sticky;
  left: 0;
}
.actions-table td { white-space: normal; }
.actions-table .num { font-variant-numeric: tabular-nums; }
.action-badge {
  display: inline-block;
  background: rgba(124,58,237,0.10);
  color: var(--primary);
  border-radius: 999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── Doc lists ── */
.doc-card .section-heading { margin-bottom: 0.5rem; }
.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.doc-item {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  padding: 0.625rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.doc-item:last-child { border-bottom: none; }
.doc-icon {
  width: 1.75rem; height: 1.75rem;
  border-radius: 0.5rem;
  display: grid; place-items: center;
  background: #f9fafb;
  border: 1px solid var(--border);
  flex-shrink: 0;
  margin-top: 0.125rem;
}
.doc-icon svg { width: 0.875rem; height: 0.875rem; color: var(--foreground-light); }
.doc-icon-ann { background: rgba(251,146,60,0.12); border-color: rgba(251,146,60,0.22); }
.doc-icon-ann svg { color: #ea580c; }
.doc-icon-report { background: rgba(124,58,237,0.10); border-color: rgba(124,58,237,0.18); }
.doc-icon-report svg { color: var(--primary); }
.doc-icon-rating { background: rgba(34,197,94,0.10); border-color: rgba(34,197,94,0.18); }
.doc-icon-rating svg { color: #16a34a; }
.doc-icon-call { background: rgba(59,130,246,0.10); border-color: rgba(59,130,246,0.18); }
.doc-icon-call svg { color: #2563eb; }
.doc-body { min-width: 0; flex: 1; }
.doc-item a {
  color: var(--foreground);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.84375rem;
  line-height: 1.4;
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  word-break: break-word;
}
.doc-item a:hover { color: var(--primary); }
.doc-item .ext-ico { width: 0.75rem; height: 0.75rem; color: var(--foreground-light); flex-shrink: 0; }
.doc-item a:hover .ext-ico { color: var(--primary); }
.doc-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.25rem;
}
.doc-date {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.125rem 0.5rem;
  color: var(--foreground-light);
}
.doc-date svg { width: 0.6875rem; height: 0.6875rem; }
.doc-note {
  font-size: 0.75rem;
  color: var(--foreground-light);
  line-height: 1.4;
}
.grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0 0.75rem;
}
.doc-item-grid { border-bottom: 1px dashed var(--border); }

/* ── Tooltip trigger ── */
.qtip { cursor: help; border-bottom: 1px dotted var(--foreground-light); }
.info-ico { width: 0.75rem; height: 0.75rem; color: var(--foreground-light); vertical-align: -2px; }
.qtip:hover .info-ico { color: var(--primary); }
.tippy-box[data-theme~='ck'] {
  background: #fff;
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.5;
  box-shadow: 0 12px 32px rgba(124,58,237,0.15);
}
.tippy-box[data-theme~='ck'] .tippy-arrow { color: #fff; }
.tippy-box[data-theme~='ck'] .tippy-content { padding: 0.5rem 0.75rem; }

/* ── Back link ── */
.back-link { margin-top: 1.25rem; }
.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground-light);
  text-decoration: none;
}
.back-link a:hover { color: var(--primary); }
.back-link svg { width: 0.875rem; height: 0.875rem; }

@media (max-width: 768px) {
  .detail-hero-inner { flex-direction: column; }
  .detail-card { padding: 1rem; }
  .stock-tabs { top: 0; border-radius: 0; margin: 0 -1rem 1rem; border-left: none; border-right: none; }
  .grid-list { grid-template-columns: 1fr; }
}

/* ── Key Metrics (latest stock_kpis snapshot) ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.kpi-cell {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.kpi-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--foreground-light);
}
.kpi-val {
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.kpi-val em { font-style: normal; font-size: 0.75rem; font-weight: 600; color: var(--foreground-light); }
.kpi-val.kpi-high { color: #059669; }
.kpi-val.kpi-low { color: #dc2626; }
@media (max-width: 768px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── NEW DISTINCT DETAIL LAYOUT ── */
.detail-hero-new { position: relative; overflow: hidden; background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 55%, #4f46e5 100%); color: #fff; padding: 1.5rem; }
.detail-hero-new-bg { position: absolute; inset: 0; background: radial-gradient(600px 300px at 85% 0%, rgba(255,255,255,0.14), transparent 60%); pointer-events: none; }
.detail-hero-new-inner { position: relative; max-width: 1280px; margin: 0 auto; }
.detail-breadcrumb { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; color: rgba(255,255,255,0.75); margin-bottom: 1rem; }
.detail-breadcrumb a { color: rgba(255,255,255,0.85); text-decoration: none; display: inline-flex; align-items: center; gap: 0.25rem; }
.detail-breadcrumb a:hover { color: #fff; }
.detail-hero-main { display: flex; gap: 1rem; align-items: flex-start; }
.detail-avatar-large { width: 3.5rem; height: 3.5rem; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.22); color: #fff; font-weight: 800; font-size: 1.125rem; flex-shrink: 0; }
.detail-hero-copy { flex: 1; min-width: 0; }
.detail-hero-copy h1 { font-size: 1.625rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 0.5rem; color: #fff; }
.hero-desc { margin: 0.5rem 0 0; color: rgba(255,255,255,0.82); font-size: 0.875rem; line-height: 1.5; max-width: 720px; }
.detail-hero-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.hero-action-btn { display: inline-flex; align-items: center; gap: 0.3125rem; background: #fff; color: #4f46e5; border-radius: 999px; padding: 0.375rem 0.75rem; font-size: 0.8125rem; font-weight: 600; text-decoration: none; }
.hero-action-btn:hover { background: #f5f3ff; }
.detail-stats-new { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-top: 1.25rem; }
.d-stat-new { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18); border-radius: 0.75rem; padding: 0.75rem; backdrop-filter: blur(6px); }
.d-stat-new.highlight { background: #fff; color: #4f46e5; border-color: #fff; }
.d-stat-new.highlight .d-stat-label { color: #6b7280; }
.d-stat-new.highlight .d-stat-val { color: #4f46e5; }
.d-stat-new .d-stat-label { display: block; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.75); }
.d-stat-new .d-stat-val { display: block; font-size: 0.9375rem; font-weight: 700; margin-top: 0.125rem; color: #fff; }
.stock-tabs-new { position: sticky; top: 56px; z-index: 5; display: flex; gap: 0.25rem; background: rgba(255,255,255,0.92); backdrop-filter: blur(8px); border: 1px solid #e5e7eb; border-radius: 0.75rem; padding: 0.25rem; margin: 1rem 1.5rem 0; overflow-x: auto; }
.stock-tabs-new .tab-link { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.5rem 0.875rem; border-radius: 0.5rem; font-size: 0.8125rem; font-weight: 600; color: #6b7280; text-decoration: none; white-space: nowrap; }
.stock-tabs-new .tab-link.active { background: #7c3aed; color: #fff; }
.stocks-detail-body { padding: 1rem 1.5rem 2rem; }
.detail-two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr); gap: 1rem; align-items: start; }
@media (max-width: 1024px) { .detail-two-col { grid-template-columns: 1fr; } .detail-stats-new { grid-template-columns: repeat(2, 1fr); } .detail-hero-main { flex-direction: column; } }
.stock-detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr); gap: 1rem; }
/* ── Detail hero — professional white, not barbie violet ── */
.detail-hero-new { background: #ffffff !important; color: #111827 !important; border: 1px solid #e5e7eb; border-top: 3px solid #7c3aed; border-radius: 0.75rem; padding: 1.5rem; }
.detail-hero-new-bg { background: radial-gradient(600px 280px at 85% 0%, rgba(124,58,237,0.06), transparent 60%), linear-gradient(180deg, #faf5ff 0%, #ffffff 55%) !important; }
.detail-hero-new .detail-breadcrumb { color: #6b7280 !important; }
.detail-hero-new .detail-breadcrumb a { color: #6b7280 !important; }
.detail-hero-new .detail-breadcrumb a:hover { color: #7c3aed !important; }
.detail-hero-new .detail-avatar-large { background: #f5f3ff !important; border: 1px solid #ede9fe !important; color: #7c3aed !important; }
.detail-hero-new .detail-hero-copy h1 { color: #111827 !important; }
.detail-hero-new .pill { background: #f9fafb !important; color: #374151 !important; border-color: #e5e7eb !important; }
.detail-hero-new .pill-symbol { background: #111827 !important; color: #fff !important; border-color: #111827 !important; }
.detail-hero-new .hero-desc { color: #6b7280 !important; }
.detail-hero-new .hero-action-btn { background: #f9fafb !important; color: #374151 !important; border: 1px solid #e5e7eb; }
.detail-hero-new .hero-action-btn:hover { background: #f3f4f6 !important; }
.detail-hero-new .detail-stats-new { margin-top: 1.25rem; }
.detail-hero-new .d-stat-new { background: #f9fafb !important; border-color: #e5e7eb !important; }
.detail-hero-new .d-stat-new.highlight { background: #111827 !important; border-color: #111827 !important; }
.detail-hero-new .d-stat-new.highlight .d-stat-label { color: #9ca3af !important; }
.detail-hero-new .d-stat-new.highlight .d-stat-val { color: #fff !important; }
.detail-hero-new .d-stat-new .d-stat-label { color: #6b7280 !important; }
.detail-hero-new .d-stat-new .d-stat-val { color: #111827 !important; }

/* ── Equal-size tile grid: Corporate Actions, Shareholding Pattern,
   Financial Results, Board Filings, Announcements, Annual Reports,
   Credit Ratings, Conference Calls — left to right, same size,
   internal scroll instead of growing ── */
/* Top row: Corporate Actions (2x width) + Announcements, side by side */
.detail-tiles-toprow {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1rem;
}
/* If Announcements has no data and is omitted, let Corporate Actions take the full row */
.detail-tiles-toprow .tile-card:only-child {
  grid-column: 1 / -1;
}

.detail-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  align-items: stretch;
}
#documents .tile-card {
  display: flex;
  flex-direction: column;
  height: 380px;
  margin-bottom: 0;
  overflow: hidden;
}
#documents .tile-card .section-heading {
  flex-shrink: 0;
}
#documents .tile-card .tile-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
}
#documents .tile-card .empty-state.tile-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
/* thin, unobtrusive scrollbar for the tile bodies */
#documents .tile-card .tile-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
#documents .tile-card .tile-scroll::-webkit-scrollbar-track { background: transparent; }
#documents .tile-card .tile-scroll::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.25); border-radius: 999px; }
#documents .tile-card .tile-scroll::-webkit-scrollbar-thumb:hover { background: rgba(124,58,237,0.4); }
#documents .tile-card .tile-scroll { scrollbar-width: thin; scrollbar-color: rgba(124,58,237,0.3) transparent; }

@media (max-width: 640px) {
  .detail-tiles-toprow { grid-template-columns: 1fr; }
  .detail-tiles-grid { grid-template-columns: 1fr; }
  #documents .tile-card { height: 320px; }
}

/* ═══════════════════════════════════════════════════════════════
   Live Price Widget  •  .sp-*
   Violet theme (#7c3aed) matching the rest of the detail page.
   ═══════════════════════════════════════════════════════════════ */

.sp-price-widget {
  /* Sits inside .detail-hero-new-inner, below detail-stats-new */
  background: linear-gradient(135deg, #f5f0ff 0%, #fdfaff 100%);
  border: 1.5px solid rgba(124,58,237,0.18);
  border-radius: 0.875rem;
  padding: 1.1rem 1.25rem 1rem;
  margin-top: 1rem;
  min-width: 220px;
  max-width: 360px;
  box-shadow: 0 2px 12px rgba(124,58,237,0.08);
  position: relative;
  overflow: hidden;
}

/* ── Shimmer skeleton ─────────────────────────────────────────── */
@keyframes sp-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.sp-shimmer {
  border-radius: 0.4rem;
  background: linear-gradient(90deg, #e8e0f7 25%, #f3eeff 50%, #e8e0f7 75%);
  background-size: 800px 100%;
  animation: sp-shimmer 1.4s infinite linear;
}

.sp-shimmer-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sp-shimmer-price {
  height: 2rem;
  width: 70%;
}

.sp-shimmer-badge {
  height: 1.1rem;
  width: 3.5rem;
  border-radius: 999px;
}

.sp-shimmer-ohlc {
  height: 1rem;
  width: 100%;
  margin-top: 0.25rem;
}

/* ── Loaded state ────────────────────────────────────────────── */
.sp-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.sp-price-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7c3aed;
  opacity: 0.75;
}

.sp-price {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #1e1b4b;
  line-height: 1.1;
  margin-bottom: 0.55rem;
  font-variant-numeric: tabular-nums;
}

/* ── OHLC row ────────────────────────────────────────────────── */
.sp-ohlc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  margin-bottom: 0.5rem;
}

.sp-ohlc-item {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.sp-ohlc-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
}

.sp-ohlc-val {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  font-variant-numeric: tabular-nums;
}

.sp-ohlc-val.sp-high { color: #059669; }
.sp-ohlc-val.sp-low  { color: #dc2626; }

/* ── Badge ───────────────────────────────────────────────────── */
.sp-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

.sp-badge-live {
  background: #d1fae5;
  color: #065f46;
}

.sp-badge-cache {
  background: #e0e7ff;
  color: #3730a3;
}

/* ── Age caption ─────────────────────────────────────────────── */
.sp-age {
  font-size: 0.675rem;
  color: #9ca3af;
  font-style: italic;
}

/* ── Unavailable / error state ───────────────────────────────── */
.sp-unavail {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #9ca3af;
  font-size: 0.8125rem;
  font-style: italic;
  padding: 0.25rem 0;
}

.sp-unavail svg,
.sp-unavail [data-lucide] {
  width: 1rem;
  height: 1rem;
  opacity: 0.6;
  flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────────────── */
.stock-tabs-new::-webkit-scrollbar {
  display: none;
}

@media (max-width: 768px) {
  .sp-price-widget {
    max-width: 100%;
    min-width: 0;
  }
  .sp-price { font-size: 1.35rem; }
  .stocks-detail-body { padding: 1rem 1rem 2rem; }
  .stock-tabs-new {
    margin: 0 -1rem 1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 0.5rem 1rem;
    scrollbar-width: none; /* Firefox */
  }
}