:root {
  --sk-color-up: #b42318;
  --sk-color-down: #087a55;
  --sk-color-neutral: #52606d;
  --sk-color-info: #175cd3;
  --sk-color-warning: #9a6700;
  --sk-color-danger: #b42318;
  --sk-color-success: #087a55;
  --sk-focus: #2563eb;
  --sk-focus-ring: rgba(37, 99, 235, .28);
  --sk-row-listed: #eaf2ff;
  --sk-row-announced: #fff7d6;
  --sk-row-rumor: #f5ecff;
  --sk-row-danger: #fff0f0;
}

* { scrollbar-width:thin; scrollbar-color:#aeb8c3 transparent; }
*::-webkit-scrollbar { width:8px; height:8px; }
*::-webkit-scrollbar-track { background:transparent; }
*::-webkit-scrollbar-thumb { border:2px solid transparent; border-radius:8px; background:#aeb8c3; background-clip:padding-box; }
*::-webkit-scrollbar-thumb:hover { background:#8795a4; background-clip:padding-box; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.search-box {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.search-box:focus { border-color: var(--sk-focus); }
.view-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s;
}
.view-toggle:hover { background: rgba(255,255,255,.25); }
.modal-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f0f0f0;
  color: #52606d;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal-close:hover { background: #e0e0e0; }
.mobile-card {
  margin-bottom: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  cursor: pointer;
  transition: box-shadow .2s;
}
.mobile-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); }

.chg-up { color: var(--sk-color-up) !important; }
.chg-dn { color: var(--sk-color-down) !important; }
.chg-flat { color: var(--sk-color-neutral) !important; }
.fin-pos, .finance-item .fv.red { color: var(--sk-color-up) !important; }
.fin-neg, .finance-item .fv.green { color: var(--sk-color-down) !important; }
.rate-pos { color: var(--sk-color-down) !important; }
.rate-neg { color: var(--sk-color-up) !important; }
.sanction-tag.on { background: var(--sk-color-danger) !important; color: #fff !important; }

tr.ah-listed,
.mobile-card.ah-listed { background: var(--sk-row-listed) !important; }
tr.ah-listed:hover { background: #dbe8ff !important; }
tr.ah-announced,
.mobile-card.ah-announced { background: var(--sk-row-announced) !important; }
tr.ah-announced:hover { background: #ffefad !important; }
tr.ah-rumor,
.mobile-card.ah-rumor { background: var(--sk-row-rumor) !important; }
tr.ah-rumor:hover { background: #eadcff !important; }
tr.sanctioned,
.mobile-card.sanctioned,
tr.sanction-row,
.mobile-card.sanction-row { background: var(--sk-row-danger) !important; }
tr.sanctioned:hover,
tr.sanction-row:hover { background: #ffdada !important; }

:where(a, button, input, select, textarea, summary, [role="button"], [tabindex]):focus-visible {
  outline: 3px solid var(--sk-focus) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--sk-focus-ring);
}

tr[role="button"],
.mobile-card[role="button"],
th[data-sort] { cursor: pointer; }

tr[role="button"]:focus-visible > td {
  box-shadow: inset 0 2px var(--sk-focus), inset 0 -2px var(--sk-focus);
}

.status-legend {
  margin: 10px 0 14px;
  color: #344054;
  font-size: 13px;
}
.status-legend > summary {
  width: max-content;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.status-legend > summary::-webkit-details-marker { display: none; }
.status-legend > summary::before { content: "▸"; }
.status-legend[open] > summary::before { content: "▾"; }
.legend-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(16, 24, 40, .18);
  border-radius: 3px;
}
.legend-swatch.listed { background: var(--sk-row-listed); }
.legend-swatch.announced { background: var(--sk-row-announced); }
.legend-swatch.rumor { background: var(--sk-row-rumor); }
.legend-swatch.danger { background: var(--sk-row-danger); }
.legend-up { color: var(--sk-color-up); font-weight: 700; }
.legend-down { color: var(--sk-color-down); font-weight: 700; }

/* Shared desktop table polish */
body.embedded:not(.mobile) .controls {
  gap: 8px !important;
  padding: 12px 16px !important;
}
body.embedded:not(.mobile) .section-title {
  flex-wrap:nowrap !important;
  min-height:0;
  padding:10px 16px !important;
}
body.embedded:not(.mobile) .section-title .controls {
  display:flex !important;
  flex-wrap:nowrap !important;
  overflow-x:auto;
  scrollbar-width:thin;
  padding:0 2px 2px 0 !important;
  border:0 !important;
}
body.embedded:not(.mobile) .section-title .controls > * { flex-shrink:0; }
body.embedded:not(.mobile) .pagination {
  gap: 8px !important;
  padding: 10px 16px 12px !important;
}

/* Freeze the market toolbar, pagination, and header while rows scroll. */
html:has(body.sk-freeze-table:not(.sk-stats-open)),
body.sk-freeze-table:not(.sk-stats-open) {
  height:100%;
  overflow:hidden !important;
}
body.sk-freeze-table:not(.sk-stats-open) > .container {
  display:flex;
  flex-direction:column;
  height:100%;
  min-height:0;
  margin-bottom:0 !important;
}
body.sk-freeze-table:not(.sk-stats-open) > .container > .section:first-child {
  display:flex;
  flex:1 1 auto;
  flex-direction:column;
  min-height:0;
  margin-bottom:0;
}
body.sk-freeze-table:not(.sk-stats-open) > .container > .section:first-child > .section-title,
body.sk-freeze-table:not(.sk-stats-open) > .container > .section:first-child > .pagination {
  flex:0 0 auto;
}
body.sk-freeze-table:not(.sk-stats-open) > .container > .section:first-child > .table-wrap {
  flex:1 1 auto;
  min-height:0;
  overflow:auto !important;
  overscroll-behavior:contain;
}
body.sk-freeze-table:not(.sk-stats-open) .table-wrap thead th {
  position:sticky;
  top:0;
  z-index:5;
}
body.sk-freeze-table:not(.sk-stats-open) .table-wrap thead th:nth-child(-n+4) {
  z-index:8;
}
body.embedded:not(.mobile) .table-wrap tbody tr {
  transition: background-color .14s ease, box-shadow .14s ease;
}
body.embedded:not(.mobile) .table-wrap tbody td { font-weight:400; }
body.embedded:not(.mobile) .table-wrap tbody td strong { font-weight:600; }
body.embedded:not(.mobile) .table-wrap .code,
body.embedded:not(.mobile) .table-wrap .date { font-weight:400; }
body.embedded:not(.mobile) .table-wrap .number,
body.embedded:not(.mobile) .table-wrap td[align="right"] { font-variant-numeric:tabular-nums; }
body.embedded:not(.mobile) .table-wrap tbody tr:hover {
  background: #eef5ff !important;
  box-shadow: inset 3px 0 #2563eb;
}

/* Keep identity columns visible while wide financial tables scroll. */
body.embedded:not(.mobile) .table-wrap table > thead > tr > :nth-child(1),
body.embedded:not(.mobile) .table-wrap table > tbody > tr > :nth-child(1) {
  position: sticky; left: 0; z-index: 4; width: 44px; min-width: 44px; max-width: 44px;
}
body.embedded:not(.mobile) .table-wrap table > thead > tr > :nth-child(2),
body.embedded:not(.mobile) .table-wrap table > tbody > tr > :nth-child(2) {
  position: sticky; left: 44px; z-index: 4; width: 44px; min-width: 44px; max-width: 44px;
}
body.embedded:not(.mobile) .table-wrap table > thead > tr > :nth-child(3),
body.embedded:not(.mobile) .table-wrap table > tbody > tr > :nth-child(3) {
  position: sticky; left: 88px; z-index: 4; width: 96px; min-width: 96px; max-width: 96px;
}
body.embedded:not(.mobile) .table-wrap table > thead > tr > :nth-child(4),
body.embedded:not(.mobile) .table-wrap table > tbody > tr > :nth-child(4) {
  position: sticky; left: 184px; z-index: 4; min-width: 150px;
  box-shadow: 1px 0 #e4e7ec;
}
body.embedded:not(.mobile) .table-wrap table > thead > tr > :nth-child(-n+4) { background:#f8f9fa; z-index:6; }
body.embedded:not(.mobile) .table-wrap table > tbody > tr > :nth-child(-n+4) { background:#fff; }
body.embedded:not(.mobile) .table-wrap table > tbody > tr:hover > :nth-child(-n+4) { background:#eef5ff !important; }
body.embedded:not(.mobile) tr.ah-listed > :nth-child(-n+4) { background:var(--sk-row-listed) !important; }
body.embedded:not(.mobile) tr.ah-announced > :nth-child(-n+4) { background:var(--sk-row-announced) !important; }
body.embedded:not(.mobile) tr.ah-rumor > :nth-child(-n+4) { background:var(--sk-row-rumor) !important; }
body.embedded:not(.mobile) tr.sanctioned > :nth-child(-n+4),
body.embedded:not(.mobile) tr.sanction-row > :nth-child(-n+4) { background:var(--sk-row-danger) !important; }

/* One compact label system across markets. */
.ah-tag, .sanction-tag, .status-tag, .phip-tag {
  min-height: 20px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 2px 7px !important;
  border-radius: 4px !important;
  font-size: 11px !important;
  line-height: 16px !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
  vertical-align: middle;
}
.pending, .no-report { color:#98a2b3 !important; font-style:normal !important; }

/* Legend becomes a small information control instead of a full toolbar row. */
.status-legend {
  position: relative;
  width: 32px;
  margin: 8px 16px 8px auto !important;
  z-index: 12;
}
.status-legend > summary {
  width: 32px;
  min-height: 32px;
  justify-content: center;
  padding: 0 !important;
  border-radius: 50% !important;
  color:#475467;
  font-size:0;
  font-weight:700;
}
.status-legend > summary::before {
  content:"" !important;
  width:16px;
  height:16px;
  background:currentColor;
  -webkit-mask:url("../assets/icons/info-circle.svg") center / contain no-repeat;
  mask:url("../assets/icons/info-circle.svg") center / contain no-repeat;
}
.status-legend[open] > summary { border-color:#98a2b3; background:#f8fafc; }
.status-legend .legend-grid {
  position:absolute;
  top:36px;
  right:0;
  width:max-content;
  max-width:min(520px,calc(100vw - 48px));
  margin:0;
  box-shadow:0 12px 30px rgba(16,24,40,.14);
}
.section-title .controls { flex:1 1 auto; min-width:0; }
.section-actions {
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
}
.section-actions .stats-toggle { margin-left:0 !important; }
.section-actions > .status-legend { flex:0 0 32px; margin:0 !important; }
.controls > .status-legend { flex:0 0 32px; margin:0 0 0 auto !important; }
.section:has(.status-legend[open]) { overflow:visible !important; }

.modal-overlay[aria-hidden="true"] { visibility: hidden; }
.modal-overlay.active[aria-hidden="false"] { visibility: visible; }

/* Restrained glass treatment for detail overlays; data tables remain opaque. */
.modal-overlay {
  background: rgba(15,23,32,.42) !important;
}
.modal-overlay .modal {
  border: 1px solid rgba(255,255,255,.74) !important;
  background: rgba(255,255,255,.9) !important;
  box-shadow: 0 24px 72px rgba(20,31,42,.28), inset 0 1px rgba(255,255,255,.82) !important;
}
.modal-overlay .modal-header {
  background: rgba(255,255,255,.58);
}


@media (max-width: 700px) {
  .legend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
