/* Orbifolio v2 theme. Loaded last: one set of tokens for type, colour and
   spacing, then the masthead, folded navigation and table refinements. */
/* Inter is served by the site itself (public/fonts, SIL Open Font License): every
   device shows the same letters and figures, and no visitor IP goes to a font host. */
@font-face { font-family: Inter; src: url("/fonts/InterVariable.woff2") format("woff2"); font-style: normal; font-weight: 100 900; font-display: swap; }
:root {
  --v2-font: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
  --bg: #0a0d12;
  --panel: #0f131a;
  --panel-2: #151a23;
  --panel-3: #1a2130;
  --line: #1f2632;
  --line-soft: #171d27;
  --text: #eef2f7;
  --muted: #9aa6b7;
  --subtle: #7d8899;
  --green: #3fd6a0;
  --red: #f4788a;
  --accent: #8fb4ff;
  --v2-radius: 12px;
}
/* The masthead is sticky: anything scrolled into view must stop below it. */
html { background: var(--bg); scroll-padding-top: 68px; }
body.v2 { background: var(--bg); color: var(--text); font-family: var(--v2-font); font-size: 14px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
/* Older stylesheets set system-ui on dialogs, menus and forms: one family for the whole page. */
body.v2, body.v2 * { font-family: var(--v2-font) !important; }
body.v2 .shell { width: min(1360px, calc(100% - 48px)); padding-top: 0; }
body.v2 :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Masthead ---------- */
body.v2 .manager-toolbar.v2-masthead {
  position: sticky; top: 0; z-index: 60; display: flex; align-items: center; flex-wrap: nowrap; gap: 6px;
  height: 58px; margin: 0 0 14px; padding: 0;
  background: var(--bg); box-shadow: 0 0 0 100vmax var(--bg), 0 1px 0 100vmax var(--line); clip-path: inset(0 -100vmax -1px);
}
body.v2 .v2-brand { order: 0; display: inline-flex; align-items: center; gap: 10px; margin-right: 6px; color: var(--text); text-decoration: none; font-size: 18px; font-weight: 650; letter-spacing: -.015em; border-radius: 8px; }
body.v2 .v2-brand img { display: block; width: 28px; height: 28px; border-radius: 8px; }
body.v2 .v2-masthead > .live-state { order: 1; display: inline-flex; align-items: center; gap: 6px; margin: 0 4px 0 2px; padding: 0; border: 0; background: none; color: var(--subtle); font-size: 12px; white-space: nowrap; }
body.v2 .v2-masthead > .live-state .live-dot { width: 6px; height: 6px; }
body.v2 .v2-masthead > .global-search-wrap { order: 2; flex: 0 1 380px; width: auto; min-width: 180px; margin: 0 auto 0 14px; }
body.v2 .v2-masthead #global-search { width: 100%; height: 36px; padding: 0 14px 0 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 13.5px; }
body.v2 .v2-masthead #global-search::placeholder { color: var(--subtle); }
body.v2 .v2-masthead #global-search:focus { border-color: #3a4c68; background: var(--panel-2); outline: none; }
body.v2 .v2-masthead .global-search-wrap > svg { left: 13px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; }
body.v2 .v2-masthead > .site-actions { order: 3; display: inline-flex; align-items: center; gap: 2px; margin: 0; }
body.v2 .v2-masthead > .movement-setting { order: 4; }
body.v2 .v2-masthead > #alert-settings-button { order: 5; }
body.v2 .v2-masthead > #alert-history-button { order: 6; }
body.v2 .v2-masthead > .account-button { order: 7; margin-left: 8px; }
/* Language menu (shell.js): a pill with a globe and the current code, next to the account button. */
body.v2 .v2-masthead > .v2-lang { order: 6; position: relative; margin-left: 4px; }
body.v2 .v2-lang-button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 9px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 650; letter-spacing: .06em; cursor: pointer; }
body.v2 .v2-lang-button svg { width: 15px; height: 15px; opacity: .85; }
body.v2 .v2-lang-button:hover, body.v2 .v2-lang-button[aria-expanded="true"] { border-color: var(--line); background: var(--panel-2); color: var(--text); }
body.v2 .v2-lang-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 70; min-width: 168px; padding: 6px; border: 1px solid #232b38; border-radius: 12px; background: var(--panel); box-shadow: var(--v2-shadow); }
body.v2 .v2-lang-menu[hidden] { display: none; }
body.v2 .v2-lang-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 36px; padding: 0 10px 0 12px; border-radius: 8px; color: var(--text); font-size: 13.5px; font-weight: 500; text-decoration: none; }
body.v2 .v2-lang-item:hover, body.v2 .v2-lang-item:focus-visible { background: var(--panel-2); outline: none; }
body.v2 .v2-lang-item svg { width: 15px; height: 15px; color: var(--accent); visibility: hidden; }
body.v2 .v2-lang-item[aria-checked="true"] { color: var(--text); }
body.v2 .v2-lang-item[aria-checked="true"] svg { visibility: visible; }
/* Undo and redo appear with the first change instead of sitting greyed out. */
body.v2 #site-undo:disabled, body.v2 #site-redo:disabled { display: none; }
body.v2 .v2-masthead .site-actions button,
body.v2 .v2-masthead > #alert-settings-button,
body.v2 .v2-masthead > #alert-history-button {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap;
}
body.v2 .v2-masthead .site-actions button:hover,
body.v2 .v2-masthead > #alert-settings-button:hover,
body.v2 .v2-masthead > #alert-history-button:hover { background: var(--panel-2); border-color: var(--line); color: var(--text); }
body.v2 .v2-masthead .site-actions svg, body.v2 .v2-masthead > button svg { width: 15px; height: 15px; flex: none; }
body.v2 .v2-masthead > .movement-setting { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
body.v2 .v2-masthead > .movement-setting:hover { background: var(--panel-2); color: var(--text); }
body.v2 .v2-masthead > .account-button { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid #33425a; background: var(--panel-3); color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap; }
body.v2 .v2-masthead > .account-button:hover { background: #222c3f; border-color: #46597a; }
body.v2 .account-button .account-avatar, body.v2 .account-button .account-dot, body.v2 .mobile-account-button .account-avatar, body.v2 .mobile-account-button .account-dot { display: none; }
body.v2 .v2-masthead > .account-button[data-signed-in="true"] { position: relative; width: 32px; padding: 0; justify-content: center; border-radius: 50%; }
body.v2 .v2-masthead > .account-button[data-signed-in="true"] svg, body.v2 .v2-masthead > .account-button[data-signed-in="true"] .account-label { display: none; }
body.v2 .v2-masthead > .account-button[data-signed-in="true"] .account-avatar { display: block; font-size: 12px; font-weight: 700; letter-spacing: .03em; }
body.v2 .v2-masthead > .account-button[data-signed-in="true"] .account-dot { position: absolute; right: -2px; bottom: -2px; display: block; width: 10px; height: 10px; border: 2px solid var(--bg); border-radius: 50%; background: var(--green); }
body.v2 .v2-masthead > .account-button[data-state="saving"] .account-dot { background: #deb980; }
body.v2 .v2-masthead > .account-button[data-state="issue"] .account-dot { background: var(--red); }
/* Account menu (account-ui.js): placed under the badge, same look as the language menu. */
body.v2 .account-menu { position: fixed; z-index: 70; min-width: 224px; max-width: 320px; padding: 6px; border: 1px solid #232b38; border-radius: 12px; background: var(--panel); box-shadow: var(--v2-shadow); }
body.v2 .account-menu[hidden] { display: none; }
body.v2 .account-menu-head { margin: 0 0 6px; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); }
body.v2 .account-menu-head strong { display: block; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
body.v2 .account-menu-head span { display: block; margin-top: 3px; color: var(--subtle); font-size: 12px; line-height: 16px; }
body.v2 .account-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer; }
body.v2 .account-menu-item:hover, body.v2 .account-menu-item:focus-visible { background: var(--panel-2); outline: none; }
body.v2 .account-menu-item svg { width: 15px; height: 15px; flex: none; color: var(--muted); }

/* ---------- Pinned assets header ---------- */
body.v2 .market-overview { border-radius: var(--v2-radius); border-color: var(--line); background: var(--panel); }

/* ---------- Region navigation: one row of regions, one row of lists ---------- */
body.v2 .shell > .tabs.region-navigation { display: block; margin: 12px 0 14px; padding: 6px; border: 1px solid var(--line); border-radius: var(--v2-radius); background: var(--panel); }
body.v2 .v2-region-tabs { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
body.v2 .v2-region-tabs::-webkit-scrollbar { display: none; }
body.v2 .v2-region-tab {
  flex: none; display: inline-flex; align-items: center; gap: 9px; min-height: 36px; padding: 0 13px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 550; line-height: 1; white-space: nowrap; cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
body.v2 .v2-region-tab:hover { color: var(--text); background: var(--panel-2); }
body.v2 .v2-region-tab[aria-selected="true"] { color: var(--text); background: var(--panel-3); box-shadow: inset 0 0 0 1px #2c384b; }
body.v2 .v2-region-tab.v2-has-active:not([aria-selected="true"])::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
body.v2 .shell > .tabs .v2-region-tab .region-emblems { flex: none; width: auto; height: auto; min-width: 0; }
body.v2 .shell > .tabs .v2-region-tab .region-emblems img { width: 18px; height: 13px; }
body.v2 .v2-region-tab .region-symbol > .region-icon, body.v2 .v2-region-tab .region-symbol .watchlist-icon { width: 16px; height: 16px; }
body.v2 .shell > .tabs .region-group { display: none; padding: 0; border: 0; }
body.v2 .shell > .tabs .region-group.v2-open { display: block; }
body.v2 .shell > .tabs .region-heading { display: none; }
body.v2 .shell > .tabs .region-watchlists { display: flex; width: 100% !important; gap: 6px; margin-top: 6px; padding: 10px 6px 4px; border-top: 1px solid var(--line-soft); }
body.v2 .shell > .tabs.region-navigation .tab { min-height: 34px; padding: 5px 11px; gap: 8px; border-radius: 9px; border-color: transparent; background: var(--panel-2); color: #c9d2df; }
body.v2 .shell > .tabs.region-navigation .tab .watchlist-title { font-size: 13px; font-weight: 500; }
body.v2 .shell > .tabs.region-navigation .tab:hover { background: var(--panel-3); border-color: #2c384b; color: var(--text); }
body.v2 .shell > .tabs.region-navigation .tab.active { background: #223250; border-color: #5f82b8; color: #fff; }
body.v2 .shell > .tabs.region-navigation .tab.active:hover { background: #283b5e; }


/* ---------- Table ---------- */
body.v2 .panel { border-radius: var(--v2-radius); border-color: var(--line); background: var(--panel); }
body.v2 .panel-head { min-height: 58px; padding: 12px 18px; }
body.v2 .panel-head h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
body.v2 .panel-head p { font-size: 12.5px; color: var(--muted); }
@media (min-width: 701px) { body.v2 .panel-head #list-meta:not(:empty) { display: block; margin-top: 4px; max-width: 80ch; line-height: 1.5; } }
body.v2 .result-count { font-size: 12.5px; color: var(--subtle); }
body.v2 .panel-actions button, body.v2 .watchlist-actions button { min-height: 32px; padding: 0 11px; border-radius: 8px; font-size: 13px; }
body.v2 .intraday-option, body.v2 .panel-actions label { font-size: 13px; }
body.v2 .table-wrap table { font-variant-numeric: tabular-nums; }
body.v2 .table-wrap thead th { color: var(--subtle); font-weight: 600; border-bottom-color: var(--line); }
body.v2 .table-wrap thead .sort-button { color: inherit; font: inherit; letter-spacing: inherit; }
body.v2 .table-wrap thead .sort-button:hover { color: var(--text); }
body.v2 .table-wrap tbody td { border-bottom-color: var(--line-soft); }
body.v2 .table-wrap tbody tr:hover td { background: #131924; }
body.v2 .table-wrap td .change { font-weight: 500; }
/* Sizes are for the desktop table only: phones keep the tighter scale of mobile.css,
   which is tuned to their fixed column widths. */
@media (min-width: 701px) {
  body.v2 .table-wrap thead th { padding-top: 11px; padding-bottom: 11px; font-size: 12px; letter-spacing: .05em; }
  body.v2 .table-wrap tbody td { padding-top: 11px; padding-bottom: 11px; font-size: 14px; }
  body.v2 .table-wrap td .change { font-size: 14px; }
}
/* Prices stay neutral; only the performance columns carry direction colour. */
body.v2 .table-wrap td.price-column,
body.v2 .table-wrap td.price-column.price-positive,
body.v2 .table-wrap td.price-column.price-negative { color: var(--text); font-weight: 500; }
body.v2 .table-wrap td.price-column.unavailable { color: var(--subtle); }
body.v2 .ranking-methodology summary { font-size: 12.5px; }
body.v2 .ranking-methodology p { font-size: 13px; line-height: 1.6; max-width: 90ch; }
body.v2 .section-filter { min-height: 28px; font-size: 12.5px; }
body.v2 .pagination button { min-height: 34px; padding: 0 14px; border-radius: 9px; font-size: 13px; }

@media (min-width: 701px) {
  body.v2 .panel:not(.explorer-mode) #asset-heading { width: 30%; }
  body.v2 .panel:not(.explorer-mode) #last-heading { width: 13%; }
  body.v2 .table-wrap th { height: 40px; padding: 8px 14px; font-size: 12px; }
  body.v2 .table-wrap td { height: 62px; padding: 10px 14px; font-size: 14px; line-height: 20px; }
  body.v2 .table-wrap th:first-child, body.v2 .table-wrap td:first-child { padding-left: 18px; }
  body.v2 .table-wrap th:last-child, body.v2 .table-wrap td:last-child { padding-right: 18px; }
  body.v2 .table-wrap .asset { gap: 12px; }
  body.v2 .table-wrap .asset-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 9px; }
  body.v2 .table-wrap .asset-symbol { font-size: 14.5px; font-weight: 600; line-height: 20px; min-height: 20px; }
  body.v2 .table-wrap .asset-name { margin-top: 1px; color: var(--muted); font-size: 12.5px; line-height: 17px; }
  body.v2 .table-wrap .price, body.v2 .table-wrap .market-cap, body.v2 .table-wrap .stock-value-column,
  body.v2 .table-wrap .ranking-value-column, body.v2 .table-wrap .change { font-size: 14px; line-height: 20px; }
  body.v2 .table-wrap .quote-unit, body.v2 .table-wrap .stock-date, body.v2 .table-wrap .ranking-metric { color: var(--subtle); font-size: 11.5px; line-height: 15px; }
  body.v2 .table-wrap .rank, body.v2 .table-wrap .rank.crypto-rank { color: var(--subtle); font-size: 12.5px; }
  body.v2 .table-wrap .drag-handle { width: 34px; height: 34px; line-height: 34px; border-radius: 9px; }
}

/* ---------- Footer ---------- */
body.v2 .site-contact { display: none; }
body.v2 footer { font-size: 12.5px; color: var(--subtle); }
body.v2 .v2-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; margin-top: 28px; padding: 18px 2px 34px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 13px; }
body.v2 .v2-footer-note { margin: 0; max-width: 72ch; line-height: 1.5; }
body.v2 .v2-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
body.v2 .v2-footer a { color: var(--muted); text-decoration: none; }
body.v2 .v2-footer a:hover { color: var(--text); text-decoration: underline; }
body.v2 .v2-footer #site-restore { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
body.v2 .v2-footer #site-restore:hover { color: var(--text); text-decoration: underline; }
body.v2 .v2-footer #site-restore svg { width: 13px; height: 13px; }

/* ---------- Narrow desktop ---------- */
@media (min-width: 701px) and (max-width: 1180px) {
  body.v2 .v2-masthead > .live-state { display: none; }
  body.v2 .v2-masthead > #alert-settings-button span, body.v2 .v2-masthead > #alert-history-button > span:not(.history-badge), body.v2 .v2-masthead .site-actions button span { display: none; }
}

/* Between the phone layout and a comfortable desktop the masthead keeps every control by dropping the name. */
@media (min-width: 701px) and (max-width: 860px) {
  body.v2 .v2-brand span { display: none; }
  body.v2 .v2-brand { margin-right: 0; }
  body.v2 .v2-masthead > .global-search-wrap { min-width: 120px; margin-left: 6px; }
}

/* ---------- Phone ---------- */
@media (max-width: 700px) {
  html { scroll-padding-top: 60px; }
  body.v2 .shell { width: calc(100% - 24px); }
  body.v2 .manager-toolbar.v2-masthead { display: flex !important; height: 50px; margin-bottom: 10px; }
  /* The bottom bar already carries search, alerts and the account on phones. */
  body.v2 .v2-masthead > :not(.v2-brand):not(.live-state):not(.v2-lang) { display: none !important; }
  body.v2 .v2-brand { font-size: 17px; }
  body.v2 .v2-masthead > .live-state { margin-left: auto; }
  body.v2 .shell > .tabs.region-navigation { margin: 10px 0 12px; padding: 5px; }
  body.v2 .v2-region-tab { min-height: 40px; padding: 0 12px; }
  body.v2 .shell > .tabs .region-watchlists { padding: 9px 3px 3px; }
  body.v2 .shell > .tabs.region-navigation .tab { min-height: 38px; }
  body.v2 .v2-footer { padding-bottom: 20px; }
}

/* Reordering stays available on phones without competing with the asset name. */
@media (max-width: 700px) {
  body.v2 .table-wrap .drag-handle { opacity: .4; }
}

/* The live dot and its "Up to date · time" words are not shown (owner choice); the status node stays for the scripts that write it. */
body.v2 .v2-masthead > .live-state { display: none !important; }
