/* ArthaSegments (public/stock-segments.js), 2026-09-24.
   Business segments from the company's results filings. Reads the v3.css
   tokens only (no token block of its own). The chart marks come from
   stock-charts.css; this file adds segment colours beyond its four slots,
   the layout, the Revenue / Segment profit switch and the tables.
   Named segments take --brand, --brass, --ink-raised, two tints of the first
   two, then --brass-strong; "Others" and "Unallocated" are neutral greys. */

.as-seg {
  container: as / inline-size;
  min-width: 0;
  color: var(--text);
  font: 400 13px/1.45 var(--ui);
}

/* ---- segment colours ---- */
.as-seg .as-p0 { --ac-color: var(--brand); }
.as-seg .as-p1 { --ac-color: var(--brass); }
.as-seg .as-p2 { --ac-color: var(--series-2); }
.as-seg .as-p3 { --ac-color: color-mix(in srgb, var(--brand) 48%, var(--paper)); }
.as-seg .as-p4 { --ac-color: color-mix(in srgb, var(--brass) 52%, var(--paper)); }
.as-seg .as-p5 { --ac-color: var(--brass-strong); }
.as-seg .as-pr { --ac-color: var(--faint); }
.as-seg .as-pr2 { --ac-color: var(--rule-strong); }
.as-key {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 3px;
  background: var(--ac-color, var(--faint));
  vertical-align: -1px;
}

/* ---- words ---- */
.as-lead {
  max-width: 78ch;
  margin: 0 0 18px;
  color: var(--muted-readable);
  font-size: 14px;
  line-height: 1.6;
}
.as-lead strong { color: var(--text-strong); font-weight: 600; }
.as-cap {
  display: block;
  margin: 0 0 10px;
  color: var(--muted);
  font: 600 11px/1.3 var(--ui);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.as-mini,
.as-src,
.as-notes li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.as-mini { margin: 10px 0 0; }
.as-src { max-width: 96ch; margin: 14px 0 0; }
.as-src a,
.as-q thead a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.as-notes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 96ch;
  margin: 14px 0 0;
  padding-left: 18px;
}
.as-empty,
.as-single {
  max-width: 78ch;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--muted-readable);
  background: var(--paper-sunk);
  font-size: 13px;
  line-height: 1.55;
}
.as-single + .as-src { margin-top: 10px; }
.as-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.as-na { color: var(--faint); cursor: help; }
.as-chg.is-up { color: var(--positive); }
.as-chg.is-down { color: var(--negative); }

/* ---- charts: the mix beside the quarters ---- */
.as-visual {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  margin: 0 0 22px;
}
@container as (min-width: 820px) {
  .as-visual { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); gap: 28px; }
}
.as-mix { min-width: 0; margin: 0; }
.as-mix .ac-donut-wrap { flex-direction: column; align-items: stretch; }
.as-mix .ac-donut .ac-frame { align-self: center; }
.as-mix .ac-donut-c strong { font-size: 14px; line-height: 1.2; }
.as-mix .ac-legend-donut { flex: none; width: 100%; max-width: 420px; }
@container as (min-width: 520px) and (max-width: 819.98px) {
  .as-mix .ac-donut-wrap { flex-direction: row; align-items: center; }
  .as-mix .ac-legend-donut { flex: 1 1 220px; max-width: 380px; }
}

.as-trend { position: relative; min-width: 0; }
.as-trend-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0 0 10px;
}
.as-trend-h .as-cap { margin: 0; }
.as-tg-r {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}
.as-tg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-sunk);
}
.as-tg label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted-readable);
  font: 600 12px/1 var(--ui);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.as-tg-r:nth-of-type(1):checked ~ .as-trend-h .as-tg label:nth-child(1),
.as-tg-r:nth-of-type(2):checked ~ .as-trend-h .as-tg label:nth-child(2) {
  color: var(--text-strong);
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}
.as-tg-r:nth-of-type(1):focus-visible ~ .as-trend-h .as-tg label:nth-child(1),
.as-tg-r:nth-of-type(2):focus-visible ~ .as-trend-h .as-tg label:nth-child(2) {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.as-tg-r:nth-of-type(1):checked ~ .as-grid-p,
.as-tg-r:nth-of-type(2):checked ~ .as-grid-r { display: none; }

.as-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px 24px;
}
@container as (min-width: 560px) { .as-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container as (min-width: 1180px) { .as-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.as-panel {
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}
.as-panel-h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  margin: 0 0 4px;
}
.as-panel-n {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  color: var(--text-strong);
  font: 600 13px/1.35 var(--ui);
}
.as-panel-n .as-key { align-self: center; }
.as-panel-v {
  color: var(--text);
  font: 600 12.5px/1.35 var(--ui);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.as-panel-v b { margin-left: 4px; font-weight: 600; }
/* The unit sits once in the caption above the panels. */
.as-panel .ac-head { display: none; }

/* ---- tables ---- */
.as-scroll {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}
.as-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.as-table th,
.as-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: right;
  white-space: nowrap;
}
.as-table th[scope="row"],
.as-table thead th:first-child {
  text-align: left;
  color: var(--text-strong);
  font-weight: 500;
}
.as-table thead th {
  vertical-align: bottom;
  color: var(--muted);
  background: var(--paper-sunk);
  font: 600 11px/1.25 var(--ui);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.as-table thead th span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.as-table tbody tr:hover td,
.as-table tbody tr:hover th { background: var(--paper-sunk); }
.as-table tfoot th,
.as-table tfoot td { border-bottom: 0; }
.as-table .as-tot th,
.as-table .as-tot td {
  border-top: 1px solid var(--rule-strong);
  color: var(--text-strong);
  font-weight: 600;
}
.as-table .as-sub-row th,
.as-table .as-sub-row td { color: var(--muted-readable); font-size: 12.5px; }
.as-table tr.as-old th,
.as-table tr.as-old td { color: var(--muted); }
.as-table td.as-old-n { text-align: left; font-size: 12.5px; }
.as-share { min-width: 116px; }
.as-bar {
  display: inline-block;
  width: 44px;
  height: 6px;
  margin-right: 8px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--rule);
  vertical-align: 1px;
}
.as-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--ac-color, var(--faint));
}

.as-all { margin: 16px 0 0; }
.as-all summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  min-height: 36px;
  padding: 8px 0;
  color: var(--text-strong);
  font: 600 13px/1.35 var(--ui);
  cursor: pointer;
  list-style: none;
}
.as-all summary::-webkit-details-marker { display: none; }
.as-all summary::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 2px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform .15s ease;
}
.as-all[open] summary::before { transform: rotate(45deg); }
.as-all summary span { color: var(--muted); font-weight: 500; font-size: 12px; }
.as-all summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
/* The segment name stays in view while the figures scroll beside it. */
.as-table th[scope="row"],
.as-table thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--paper);
}
.as-table thead th:first-child { background: var(--paper-sunk); }
@container as (max-width: 559.98px) {
  .as-table { min-width: 520px; }
  .as-bar { display: none; }
  .as-share { min-width: 0; }
  .as-table th,
  .as-table td { padding: 8px 10px; }
  .as-table th[scope="row"] { min-width: 112px; max-width: 150px; white-space: normal; }
}
.as-q { min-width: 760px; }
.as-q th,
.as-q td { padding: 8px 10px; }
.as-q th:first-child {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--paper);
}
.as-q .as-sec th {
  padding-top: 14px;
  color: var(--muted);
  background: var(--paper);
  font: 600 11px/1.3 var(--ui);
  letter-spacing: .06em;
  text-align: left;
  text-transform: uppercase;
}
.as-q td.is-gap,
.as-q th.is-gap { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--canvas-wash) 6px 8px); }
.as-q sup { margin-left: 1px; color: var(--negative); }

@media (pointer: coarse) {
  .as-tg label { min-height: 44px; padding: 0 18px; }
  .as-all summary { min-height: 44px; }
}
@media (max-width: 420px) {
  .as-lead { font-size: 13.5px; }
  .as-table th,
  .as-table td { padding: 8px 10px; }
}
