/* krinai.com's company pages (src/pages.ts), over site.css: the app's colours for news
   (web/src/styles/tokens.css: green good, red bad, grey within, ink where the good direction
   depends on the company), in light and dark. */

:root {
  --good: #136f37;
  --good-fill: #1a8f47;
  --bad: #b8312f;
  --bad-fill: #e0524f;
  --within-fill: #8b93a0;
  --neutral-fill: #4b5361;
  --band: #c9dce6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --good: #4cc47e;
    --good-fill: #188c48;
    --bad: #f08a86;
    --bad-fill: #d9534f;
    --within-fill: #7d8693;
    --neutral-fill: #b4bbc5;
    --band: #23404d;
  }
}

.co {
  max-width: 1040px;
  padding-bottom: 72px;
}
.small {
  font-size: 13px;
}
.muted {
  color: var(--ink-3);
}
.num {
  font-variant-numeric: tabular-nums;
}
.crumbs {
  margin-top: 12px;
  color: var(--ink-3);
}
.crumbs a,
.co-meta a,
.co-foot a,
.co .toc a {
  color: var(--ink-3);
}
.crumbs a:hover,
.co-meta a:hover,
.co-foot a:hover,
.co .toc a:hover {
  color: var(--accent);
}
/* the list's sectors, as quiet as the landing page's (site.css, .browse) */
.co .toc {
  color: var(--ink-4);
}
.co .toc a {
  text-decoration: none;
  white-space: nowrap;
}
.co .toc a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ head */

.co-head {
  margin-top: 20px;
}
.co-head h1 {
  font-size: clamp(28px, 4.4vw, 42px);
  line-height: 1.15;
}
.tkr {
  color: var(--ink-3);
  font-weight: 500;
  font-size: 0.62em;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.co-meta {
  margin: 10px 0 0;
  color: var(--ink-3);
}
.co-summary {
  margin: 22px 0 0;
  max-width: 78ch;
  font-size: 16px;
  color: var(--ink-2);
}
.co-since {
  margin: 10px 0 0;
  max-width: 88ch;
  color: var(--ink-3);
}
/* when the figures are from, and when they were checked */
.co-updated {
  margin: 8px 0 0;
  color: var(--ink-2);
}
/* how much krinai holds, and the way in: under the summary */
.co-hook {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 22px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.co-hook p {
  flex: 1 1 48ch;
  margin: 0;
  color: var(--ink-2);
}
/* the filings a card's figure was stated in */
.card-src {
  margin-top: 6px;
}
.card-src a {
  color: var(--ink-3);
}
.card-src a:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------------ sections */

.co-section {
  margin-top: 48px;
}
.co-section h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.card-name {
  font-weight: 600;
}
.card-value {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 600;
  font-stretch: 100%;
  line-height: 1.25;
}
.card-value.relative {
  font-size: 15px;
  font-weight: 500;
}
.card-notes,
.card-gaap {
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 12px;
}
.card-rev {
  margin-top: 10px;
}
.card-track {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
}
.rev {
  font-size: 13px;
  font-weight: 600;
}
.rev.good {
  color: var(--good);
}
.rev.bad {
  color: var(--bad);
}
.rev.neutral,
.rev.maintained {
  color: var(--ink-2);
}
.rev.new {
  color: var(--accent);
}

.track-text {
  margin: 0;
  max-width: 78ch;
  font-size: 16px;
  color: var(--ink-2);
}
.co-chart {
  margin: 20px 0 0;
  padding: 16px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.chart {
  display: block;
  width: 100%;
  height: auto;
}
.chart .grid {
  stroke: var(--line);
  stroke-width: 1;
}
.chart .tick {
  fill: var(--ink-3);
  font-family: var(--font);
  font-size: 11px;
}
/* the fiscal year under its quarters (chart.ts, the axis's second line) */
.chart .year {
  fill: var(--ink-2);
  font-weight: 600;
}
.chart .band {
  fill: var(--band);
}
.chart .dot {
  stroke: var(--surface);
  stroke-width: 1.5;
}
.dot.good {
  fill: var(--good-fill);
  background: var(--good-fill);
}
.dot.bad {
  fill: var(--bad-fill);
  background: var(--bad-fill);
}
.dot.within,
.dot.indet {
  fill: var(--within-fill);
  background: var(--within-fill);
}
.dot.neutral {
  fill: var(--neutral-fill);
  background: var(--neutral-fill);
}
.co-chart figcaption {
  margin-top: 8px;
}
.legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  margin-left: 6px;
}
.legend i.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 3px;
  border-radius: 50%;
}

.co-more {
  padding: 28px;
  border-radius: 8px;
  background: var(--accent-wash);
}
.co-more p {
  margin: 0;
  color: var(--ink-2);
}
.more-list {
  margin: 14px 0 0;
  padding-left: 20px;
}
.more-list li + li {
  margin-top: 6px;
}
.more-list a {
  color: var(--ink);
  text-decoration-color: var(--accent);
}
.more-list a:hover {
  color: var(--accent);
}
.actions.left {
  justify-content: flex-start;
  align-items: center;
  margin-top: 22px;
}
.actions.left .fine {
  margin: 0;
}

.peers,
.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.peers a,
.list a {
  text-decoration: none;
}
.peers a:hover,
.list a:hover {
  color: var(--accent);
}
.peers .tkr,
.list .tkr {
  font-size: 12px;
}

.co-foot {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  max-width: 100ch;
}

/* ------------------------------------------------------------------ the list of companies */

/* the search box atop the list (site.css's, aligned with the page) */
.find.left {
  max-width: 640px;
  margin: 22px 0 0;
  text-align: left;
}

.toc {
  margin-top: 16px;
  line-height: 2;
}
.sector {
  margin-top: 44px;
  scroll-margin-top: 16px;
}
.sector h2 {
  font-size: 22px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.industries {
  display: grid;
  gap: 22px;
  margin-top: 18px;
}
.industry h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
}

.co-more .button {
  white-space: normal;
  text-align: center;
}

@media (max-width: 640px) {
  .co-more {
    padding: 20px;
  }
  /* the chart keeps a width its labels read at, and scrolls in its box */
  .co-chart {
    overflow-x: auto;
  }
  .chart {
    min-width: 560px;
  }
  .card-value {
    font-size: 20px;
  }
}
