/*
  Investor portal styles on the Uniborn UI kit (ui-kit/tokens/tokens.css + ui-kit/css/uniborn-ui.css).
  Only layout and the letter typography live here; every colour, size and radius is a kit token.
  Kit rules kept: ink and greys only, colour for outcomes; Brygada for titles, key figures and prose
  section titles; Public Sans for everything else, nothing below 12px; borders, not shadows.
*/
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; }
a { color: inherit; }
:where(a, button, input, summary):focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ub-bg), 0 0 0 4px var(--ub-focus); border-radius: var(--ub-radius-sm); }
.boot { padding: var(--ub-space-8); color: var(--ub-muted); }
svg.i { width: 16px; height: 16px; flex: none; }

/* App shell: sidebar + content; bottom navigation below 600px */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .ub-sidebar__logo svg { color: var(--ub-ink); }
.side__note { margin: var(--ub-space-4) 8px 0; font-size: 12px; line-height: 1.5; color: var(--ub-faint); }
.side__note a { color: var(--ub-muted); }
.content { padding: 28px 32px 64px; max-width: 1240px; width: 100%; }
.bottomnav { display: none; }
.mobile-logo { display: none; }
@media (max-width: 900px) { .shell { grid-template-columns: 196px minmax(0, 1fr); } .content { padding: 24px 24px 56px; } }
@media (max-width: 600px) {
  .shell { display: block; }
  .side { display: none; }
  .content { padding: 20px 16px 96px; }
  .mobile-logo { display: block; color: var(--ub-ink); margin-bottom: 18px; }
  .bottomnav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset: auto 0 0 0; z-index: 10; background: var(--ub-sidebar); border-top: 1px solid var(--ub-rule); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bottomnav a { display: grid; justify-items: center; gap: 3px; padding: 6px 4px; border-radius: var(--ub-radius-md); color: var(--ub-muted); text-decoration: none; font: 500 12px/1.2 var(--ub-font-sans); min-height: 48px; }
  .bottomnav a[aria-current=page] { color: var(--ub-ink); background: var(--ub-surface); box-shadow: inset 0 0 0 1px var(--ub-rule); }
  .bottomnav svg { width: 18px; height: 18px; }
}

.admin { margin: -28px -32px 24px; flex-wrap: wrap; }
.admin button { border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; opacity: .85; cursor: pointer; padding: 0; }
@media (max-width: 900px) { .admin { margin: -24px -24px 20px; } }
@media (max-width: 600px) { .admin { margin: 0 -16px 18px; } }

.ub-page-head { margin-bottom: 24px; }
.ub-title { text-wrap: balance; max-width: 28ch; }
.stack { display: grid; gap: 24px; }
.two { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .two { grid-template-columns: minmax(0, 1fr); } }

/* KPIs */
.ub-kpi .ub-figure { display: block; }
@media (max-width: 600px) { .ub-kpis { grid-template-columns: 1fr 1fr; } .ub-kpi:nth-child(3) { padding-left: 0; border-left: 0; } .ub-kpi:nth-child(n+3) { border-top: 1px solid var(--ub-rule); } }

/* Chart */
.chart { position: relative; }
.chart svg { display: block; width: 100%; }
.chart .grid { stroke: var(--ub-rule); }
.chart .axis { fill: var(--ub-faint); font: 400 12px var(--ub-font-sans); font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--ub-ink); }
.chart .bar.is-neg { fill: var(--ub-negative); }
.chart .bar.is-dim { fill: var(--ub-rule-strong); }
.chart .grid.zero { stroke: var(--ub-muted); }
.chart .line { fill: none; stroke: var(--ub-muted); stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 5 3; pointer-events: none; }
.chart .line-halo { fill: none; stroke: var(--ub-surface); stroke-width: 6; stroke-linejoin: round; pointer-events: none; }
.chart .dot { fill: var(--ub-surface); stroke: var(--ub-muted); stroke-width: 2; pointer-events: none; }
.chart-key { display: flex; gap: 16px; font-size: 12px; color: var(--ub-muted); margin-bottom: 4px; }
.chart-key span { display: inline-flex; align-items: center; gap: 6px; }
.chart-key .key-bar { width: 10px; height: 10px; border-radius: 2px; background: var(--ub-ink); }
.chart-key .key-line { width: 16px; height: 0; border-top: 2px dashed var(--ub-muted); }
.chart .peak { fill: var(--ub-muted); font: 500 12px var(--ub-font-sans); font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; }
.chart .ub-tooltip { position: absolute; transform: translate(-50%, calc(-100% - 8px)); pointer-events: none; white-space: nowrap; }
.chart .ub-tooltip.is-end { transform: translate(calc(-100% + 14px), calc(-100% - 8px)); }
.chart .ub-tooltip.is-end::after { left: calc(100% - 14px); }
.chart .ub-tooltip.is-start { transform: translate(-14px, calc(-100% - 8px)); }
.chart .ub-tooltip.is-start::after { left: 14px; }
.chart-cap { font-size: 12px; color: var(--ub-muted); }
.chart-card .ub-card__head { flex-wrap: wrap; }

/* Tables inside cards */
.ub-card > .ub-table-wrap .ub-table th:first-child, .ub-card > .ub-table-wrap .ub-table td:first-child { padding-left: 16px; }
.ub-card > .ub-table-wrap .ub-table th:last-child, .ub-card > .ub-table-wrap .ub-table td:last-child { padding-right: 16px; }
.ub-table th { background: var(--ub-surface-2); }
.ub-table .soft { color: var(--ub-muted); }
@media (max-width: 600px) { .ub-table--stack td { text-align: right; } }

/* Latest update card */
.hl { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; line-height: 1.5; max-width: 90ch; }

/* Archive */
.ub-toolbar .ub-input { width: min(320px, 100%); }
.ub-toolbar .ub-input svg { width: 15px; height: 15px; color: var(--ub-faint); }
.letter { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 14px 16px; border-bottom: 1px solid var(--ub-rule); text-decoration: none; color: inherit; }
.letter:hover { background: var(--ub-surface-2); }
.letter__t { font: 600 14px/1.35 var(--ub-font-sans); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.letter__hl { margin: 3px 0 0; font-size: 13px; line-height: 1.5; color: var(--ub-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.letter__side { font-size: 12px; color: var(--ub-faint); white-space: nowrap; padding-top: 2px; }
.letter__date { font-size: 13px; color: var(--ub-muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.yearhead { padding: 10px 16px; background: var(--ub-surface-2); border-bottom: 1px solid var(--ub-rule); font: 600 13px/1.3 var(--ub-font-sans); display: flex; justify-content: space-between; }
.yearhead span { font-weight: 500; color: var(--ub-muted); }
.year:last-child .letter:last-child { border-bottom: 0; }
@media (max-width: 600px) { .letter { grid-template-columns: minmax(0, 1fr); gap: 4px; } .letter__side { padding: 0; } }

/* Reader */
.reader { display: grid; grid-template-columns: minmax(0, 680px) 240px; gap: 40px; align-items: start; }
@media (max-width: 1100px) { .reader { grid-template-columns: minmax(0, 1fr); gap: 24px; } .toc { display: none; } }
.aside { position: sticky; top: 24px; display: grid; gap: 16px; }
.toc .ub-subnav { padding: 8px; }
.toc .ub-subnav a { white-space: normal; justify-content: flex-start; }
.toc .ub-subnav a.sub { padding-left: 20px; }
.prose { font: 400 var(--ub-text-lg)/1.68 var(--ub-font-sans); color: var(--ub-ink); }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose h3 { font: 500 var(--ub-title-md)/1.2 var(--ub-font-serif); letter-spacing: -0.01em; margin: 40px 0 14px; padding-top: 20px; border-top: 1px solid var(--ub-rule); }
.prose h4 { font: 500 var(--ub-title-sm)/1.25 var(--ub-font-serif); margin: 32px 0 10px; }
.prose strong { font-weight: 600; }
.prose a { text-decoration-color: var(--ub-rule-strong); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--ub-ink); }
.prose blockquote { margin: 24px 0; border-left: 2px solid var(--ub-ink); background: var(--ub-surface); padding: 12px 16px; border-radius: 0 8px 8px 0; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { display: block; max-width: 100%; height: auto; margin: 24px 0 8px; border: 1px solid var(--ub-rule); border-radius: var(--ub-radius-lg); background: var(--ub-surface); }
.prose .cap { display: block; font-size: 13px; line-height: 1.5; color: var(--ub-muted); margin-bottom: 24px; }
.prose code { font: 400 14px/1.6 var(--ub-font-mono); }
.prose hr { border: 0; border-top: 1px solid var(--ub-rule); margin: 32px 0; }
.prose .ub-card { margin: 24px 0; }
@media (max-width: 600px) { .prose h3 { font-size: var(--ub-title-sm); } .prose h4 { font-size: 18px; } }
.embed { text-decoration: none; color: inherit; }
.embed:hover { background: var(--ub-surface-2); }
.embed .ub-row__main b { font-weight: 600; }

.checks { list-style: none; margin: 0; padding: 0; }
.checks li { padding: 10px 16px; border-bottom: 1px solid var(--ub-rule); }
.checks li:last-child { border-bottom: 0; }
.checks .ub-check { align-items: flex-start; font-size: 13px; line-height: 1.45; }
.checks .ub-check input { margin-top: 1px; }
.checks input:checked + span { color: var(--ub-faint); text-decoration: line-through; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.pager a { display: block; padding: 14px 16px; text-decoration: none; }
.pager a:hover { background: var(--ub-surface-2); }
.pager small { display: block; font-size: 12px; color: var(--ub-muted); margin-bottom: 2px; }
.pager b { font-weight: 600; }
.pager .next { text-align: right; }

.legal { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--ub-rule); font-size: 12px; line-height: 1.55; color: var(--ub-muted); max-width: 760px; }
.legal p { margin: 4px 0 0; }

/* Publishing */
.code { position: relative; background: var(--ub-surface-2); border-radius: var(--ub-radius-md); margin: 0 16px 16px; }
.code pre { margin: 0; padding: 10px 12px; padding-right: 76px; overflow-x: auto; font: 400 13px/1.5 var(--ub-font-mono); }
.code .ub-btn { position: absolute; top: 3px; right: 3px; }
.pub .ub-timeline { padding: 16px 16px 2px; }
.ub-dl dd .ub-status { justify-content: flex-end; }
.ub-table td:first-child { white-space: nowrap; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 24px; }
.prose .charts { margin: 24px 0; }
.prose .charts .ub-card { margin: 0; }

/* Approve and publish (editor view) */
.approve { margin: 32px 0 0; }
.approve .ub-card__body p { margin: 0 0 8px; font-size: 14px; line-height: 1.55; }
.approve .ub-card__body p:last-child { margin-bottom: 0; }
.approve__note { color: var(--ub-muted); }
.approve .ub-alert { margin-top: 12px; }
.approve .ub-card__foot { flex-wrap: wrap; gap: 12px; }
.approve__btns { display: inline-flex; gap: 8px; margin-left: auto; }
.pub .approve { margin: 0; }
