:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --up-text: #006300;
  --down-text: #c23a3a;
  --div-up: #0ca30c;
  --div-down: #e34948;
  --div-mid: #f0efec;
  --bar: #2a78d6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --up-text: #0ca30c;
    --down-text: #e66767;
    --div-up: #0ca30c;
    --div-down: #e66767;
    --div-mid: #383835;
    --bar: #3987e5;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --up-text: #0ca30c;
  --down-text: #e66767;
  --div-up: #0ca30c;
  --div-down: #e66767;
  --div-mid: #383835;
  --bar: #3987e5;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--series-1); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; letter-spacing: -0.01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; margin-bottom: 10px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up-text); }
.down { color: var(--down-text); }

.top { position: sticky; top: 0; z-index: 5; background: var(--page); border-bottom: 1px solid var(--border); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.brand p { margin: 2px 0 0; font-size: 13px; }
.top-meta { display: flex; align-items: center; gap: 10px; }
.ghost { background: none; border: 1px solid var(--border); color: var(--ink); border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 15px; }

main { padding-top: 16px; padding-bottom: 32px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  min-width: 0;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.card > h2 { margin-bottom: 12px; }
.section-title { margin: 24px 0 12px; font-size: 19px; }
.grid { display: grid; gap: 16px; }
.grid > .card { margin-bottom: 0; }
.grid { margin-bottom: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) {
  .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); }
}

.hero { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 16px; margin-bottom: 16px; }
.hero .card { margin-bottom: 0; }
@media (max-width: 720px) { .hero { grid-template-columns: 1fr 1fr; } .hero .mix { grid-column: 1 / -1; } }
.label { font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.big { font-size: 34px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 4px; }
.mixbar { display: flex; height: 14px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 10px 0 8px; background: var(--surface); }
.mixbar .seg { display: block; height: 100%; }
.mixbar .s1 { background: var(--series-1); }
.mixbar .s2 { background: var(--series-2); }
.mixlegend { display: flex; gap: 16px; flex-wrap: wrap; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.clocks { padding: 12px 16px; }
.clock-row { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.clock-row .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--axis); }
.clock-row .open .dot { background: #0ca30c; }

.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tab { border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); border-radius: 8px; padding: 7px 16px; font: inherit; cursor: pointer; }
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--ink-2); font-weight: 600; }

.heat { position: relative; width: 100%; height: 340px; }
.heat .cell {
  position: absolute; overflow: hidden; border-radius: 4px;
  padding: 4px 6px; font-size: 12px; line-height: 1.2; cursor: default;
  border: 1px solid var(--surface);
}
.heat .cell b { display: block; font-size: 13px; }
.heat-legend { margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-left: 6px; }
.sw.down { background: var(--div-down); }
.sw.flat { background: var(--div-mid); border: 1px solid var(--border); }
.sw.up { background: var(--div-up); }

.topflop { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.topflop h4 { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.topflop .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--grid); }
.topflop .row:last-child { border-bottom: 0; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--axis); white-space: nowrap; cursor: pointer; user-select: none; }
table.data th.r, table.data td.r { text-align: right; }
table.data td { padding: 7px 8px; border-bottom: 1px solid var(--grid); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data tr.others td { color: var(--ink-2); font-style: italic; }
.wbar { display: inline-block; height: 6px; border-radius: 0 3px 3px 0; background: var(--bar); vertical-align: middle; margin-right: 8px; }
.sym { font-weight: 600; }
.name { color: var(--ink-2); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.score-pill { display: inline-block; min-width: 30px; text-align: center; border: 1px solid var(--border); border-radius: 10px; padding: 0 6px; font-size: 12px; }

.bars .b { display: grid; grid-template-columns: 120px 1fr 56px; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.bars .track { height: 10px; }
.bars .fill { height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }

.chart { width: 100%; min-height: 260px; position: relative; }
.chart svg { display: block; width: 100%; height: 280px; }
.chart .empty { padding: 40px 0; text-align: center; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }

.quotes .q { display: grid; grid-template-columns: 1fr auto 72px; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--grid); font-size: 14px; }
.quotes .q:last-child { border-bottom: 0; }
.quotes .q span:nth-child(2), .quotes .q span:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }

.kv { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--grid); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv b { font-variant-numeric: tabular-nums; font-weight: 600; }
.gauge { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--div-down), var(--div-mid), var(--div-up)); position: relative; margin: 8px 0 14px; }
.gauge i { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 2px; background: var(--ink); transform: translateX(-2px); }

.yields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.yields h4 { margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
@media (max-width: 860px) { .yields { grid-template-columns: minmax(0, 1fr); } }

.news { list-style: none; margin: 0; padding: 0; }
.news li { padding: 8px 0; border-bottom: 1px solid var(--grid); }
.news li:last-child { border-bottom: 0; }
.news a { color: var(--ink); }
.news .when { display: block; font-size: 12px; color: var(--muted); }

.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a { border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; color: var(--ink); }

footer { padding: 8px 0 24px; }

.tip {
  position: fixed; z-index: 20; pointer-events: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  max-width: 260px;
}
.tip .t { font-weight: 600; margin-bottom: 2px; }

.pages { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 0; }
.page-link { padding: 8px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.page-link:hover { text-decoration: none; color: var(--ink); }
.page-link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--series-1); }
.narrow { max-width: 640px; }

.ticker { border-top: 1px solid var(--border); background: var(--surface); font-size: 14px; }
/* The moving strip stays inside the page's content width, faded at both ends. */
.ticker-window {
  max-width: 1148px; margin: 0 auto; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}
@media (max-width: 1180px) { .ticker-window { margin: 0 16px; } }
.ticker-track { display: flex; width: max-content; animation: ticker 50s linear infinite; }
@media (hover: hover) { .ticker:hover .ticker-track { animation-play-state: paused; } }
.ticker .tr { display: flex; align-items: center; gap: 18px; padding: 7px 18px 7px 0; white-space: nowrap; }
.ticker .tl { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 4px; border: 1px solid currentColor; }
.ticker .tl.down { margin-left: 10px; }
.ticker .ti b { font-weight: 600; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; flex: none; }
.wordmark { font-size: 21px; font-weight: 400; letter-spacing: 0.14em; line-height: 1; }
.wordmark span { font-weight: 800; color: var(--series-1); }

/* Larger logo, set apart from the section buttons below it. */
.top-row { padding-top: 16px; padding-bottom: 14px; }
.brand { gap: 12px; }
.brand .mark { width: 46px; height: 46px; }
.wordmark { font-size: 30px; letter-spacing: 0.12em; }

/* Section buttons: raised pills that look clickable. */
.pages { gap: 10px; padding-top: 2px; padding-bottom: 12px; }
.page-link {
  font-size: 16px; font-weight: 600; color: var(--ink);
  padding: 9px 20px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.10), 0 3px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.page-link:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 6px 14px rgba(0, 0, 0, 0.12); }
.page-link:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.page-link[aria-current="page"] {
  background: var(--series-1); color: #fff; border-color: transparent;
  box-shadow: 0 2px 6px rgba(42, 120, 214, 0.35), 0 6px 16px rgba(42, 120, 214, 0.25);
}
:root[data-theme="dark"] .page-link { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 4px 10px rgba(0, 0, 0, 0.5); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .page-link { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 4px 10px rgba(0, 0, 0, 0.5); }
}
@media (max-width: 560px) {
  .brand .mark { width: 38px; height: 38px; }
  .wordmark { font-size: 22px; }
  .page-link { font-size: 15px; padding: 8px 14px; }
}

/* Second band: exchange hours. */
.ticker-clocks { font-size: 13px; }
.ticker-clocks .ticker-track { animation-duration: 60s; }
.ticker-clocks .tr { gap: 30px; padding-right: 30px; }
.ticker-clocks .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--axis); }
.ticker-clocks .open .dot { background: #0ca30c; }

/* Band lines and background stop where the fade ends, instead of running edge to edge. */
.top { border-bottom: none; }
.ticker { border-top: none; background: transparent; }
.ticker .ticker-window { border-top: 1px solid var(--border); background: var(--surface); }
.ticker-clocks .ticker-window { border-bottom: 1px solid var(--border); }

/* Breathing room between the bands and the first cards. */
main.wrap { padding-top: 28px; }

/* One spacing step everywhere, so every gap on the page is the same. */
:root { --gap: 20px; }
main.wrap { padding-top: var(--gap); }
.card { margin-bottom: var(--gap); }
.grid { gap: var(--gap); margin-bottom: var(--gap); }
.hero { gap: var(--gap); margin-bottom: var(--gap); }
.tabs { margin-bottom: var(--gap); gap: 8px; }
.section-title { margin: var(--gap) 0; }
.top-row { padding-top: var(--gap); padding-bottom: var(--gap); }
.pages { padding-bottom: var(--gap); }
#page-stiri > p { margin: 0 0 var(--gap); }
@media (max-width: 560px) { :root { --gap: 14px; } }

/* Phones: the same page, with a compact positions table (no names, no score, short headers). */
table.data .short { display: none; }
@media (max-width: 640px) {
  table.data { font-size: 13px; }
  table.data th, table.data td { padding: 7px 5px; }
  table.data .name, table.data [data-k="name"], table.data [data-k="score"] { display: none; }
  table.data .wbar { display: none; }
  table.data .full { display: none; }
  table.data .short { display: inline; }
  .table-wrap { overflow-x: visible; }
}

/* On phones the tall header scrolls away instead of covering half the screen. */
@media (max-width: 640px) { .top { position: static; } }

/* Phones: return-card titles stay on one line so both values sit at the same height. */
@media (max-width: 720px) {
  .hero .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
  .hero .big { font-size: 28px; }
}
/* Fades drawn as overlays instead of a CSS mask: iOS Safari freezes, then blanks, an animated
   strip inside a masked box. */
.ticker-window { position: relative; -webkit-mask-image: none; mask-image: none; }
.ticker-window::before, .ticker-window::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40px; z-index: 1; pointer-events: none;
}
.ticker-window::before { left: 0; background: linear-gradient(90deg, var(--surface), transparent); }
.ticker-window::after { right: 0; background: linear-gradient(270deg, var(--surface), transparent); }
.ticker-track { will-change: transform; -webkit-animation: ticker 50s linear infinite; }
.ticker-clocks .ticker-track { -webkit-animation-duration: 60s; }
@-webkit-keyframes ticker { from { -webkit-transform: translate3d(0, 0, 0); } to { -webkit-transform: translate3d(-50%, 0, 0); } }
@keyframes ticker { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }

/* Company analyses */
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.an-grid .card { margin-bottom: 0; }
.an-card { color: var(--ink); display: flex; flex-direction: column; gap: 6px; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.an-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12); }
.an-top { display: flex; justify-content: space-between; align-items: center; }
.an-ticker { font-size: 20px; letter-spacing: 0.02em; }
.an-name { color: var(--ink-2); }
.an-verdict { font-weight: 600; }
.an-back { display: inline-block; margin-bottom: 12px; font-weight: 500; }
.an-head h2 { font-size: 24px; margin-bottom: 8px; }
.an-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.an-body { line-height: 1.6; max-width: 820px; }
.an-body h3 { margin: 22px 0 8px; font-size: 17px; }
.an-body table { border-collapse: collapse; margin: 8px 0 14px; font-size: 14px; display: block; overflow-x: auto; }
.an-body th, .an-body td { padding: 6px 10px; border-bottom: 1px solid var(--grid); text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.an-body th { color: var(--ink-2); font-weight: 500; border-bottom-color: var(--axis); }
.an-body ul { padding-left: 20px; }
.an-disclaimer { margin-top: 20px; }
