/* ============================================================
   /numbers/ - one Win95 property sheet, one tab per company.

   Loaded AFTER assets/css/style.css, which assumes a fixed-height
   desktop. This page scrolls, so the first block undoes that.

   Every chart here is a Win95 widget: sunken wells, segmented
   progress fills, and one SVG donut per sheet. No chart library.
   ============================================================ */

html, body {
  height: auto;
  min-height: 100%;
  overflow: visible;
  user-select: text;
}
body {
  background: #008080;
  padding: 0 0 56px;
}

/* ------------------------------------------------------------
   The window
   ------------------------------------------------------------ */
.np-shell {
  max-width: 960px;
  margin: 26px auto;
  padding: 0 14px;
}

.np-window {
  background: #c0c0c0;
  border: 2px outset #c0c0c0;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .35);
}

.np-titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px 0 6px;
  font-weight: bold;
  font-size: 12px;
}
.np-titlebar .np-title { display: flex; align-items: center; gap: 6px; }
.np-titlebar img { width: 16px; height: 16px; }
.np-fakebtns { display: flex; gap: 2px; }
.np-fakebtns span {
  width: 18px; height: 16px;
  background: #c0c0c0;
  border: 1px outset #c0c0c0;
  color: #000;
  font-size: 10px;
  font-weight: bold;
  display: flex; align-items: center; justify-content: center;
}

.np-menubar {
  display: flex;
  gap: 2px;
  padding: 2px 4px;
  border-bottom: 1px solid #808080;
  box-shadow: 0 1px 0 #fff;
}
.np-menubar a, .np-menubar span {
  padding: 2px 8px;
  font-size: 12px;
  color: #000;
  text-decoration: none;
}
.np-menubar a:hover { background: #000080; color: #fff; }

.np-body { padding: 12px; }

/* ------------------------------------------------------------
   Property-sheet tabs
   ------------------------------------------------------------ */
.np-tabstrip {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding-left: 2px;
  position: relative;
  z-index: 2;
  margin-bottom: -2px;
  flex-wrap: wrap;
}

.np-tab {
  appearance: none;
  font-family: inherit;
  font-size: 12px;
  padding: 5px 14px 6px;
  margin-bottom: 0;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #808080 #c0c0c0 #fff;
  border-bottom: none;
  cursor: pointer;
  color: #000;
  position: relative;
  top: 2px;
}
.np-tab:hover { background: #d4d4d4; }
.np-tab:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
.np-tab[aria-selected="true"] {
  top: 0;
  padding: 7px 16px 8px;
  font-weight: bold;
  background: #c0c0c0;
  z-index: 3;
}
/* the accent only shows on the selected tab, so the strip reads as a row
   of folders with one pulled forward */
.np-tab[aria-selected="true"]::before {
  content: "";
  position: absolute;
  left: 2px; right: 2px; top: 0;
  height: 3px;
  background: var(--accent, #000080);
}

.np-pane {
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  background: #c0c0c0;
  padding: 14px;
  position: relative;
  z-index: 1;
}
.np-pane[hidden] { display: none; }

/* ------------------------------------------------------------
   Bevels
   ------------------------------------------------------------ */
.sunkenish {
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  box-shadow: inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 #000;
  background: #c0c0c0;
}
.sunkenish-in {
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #dfdfdf;
  background: #fff;
}

/* ------------------------------------------------------------
   Sheet header and stat tiles
   ------------------------------------------------------------ */
.xls-head {
  background: var(--accent, #000080);
  color: #fff;
  padding: 7px 10px;
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.xls-co { font-weight: bold; font-size: 14px; }
.xls-meta { flex: 1; color: rgba(255, 255, 255, .78); font-size: 11px; }
.xls-stamp {
  background: #c0c0c0;
  color: #000;
  padding: 2px 7px;
  border: 1px solid;
  border-color: #fff #000 #000 #fff;
  font-weight: bold;
  font-size: 11px;
  white-space: nowrap;
}

.xls-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 16px;
}
.xls-tile { padding: 10px 7px; text-align: center; }
.xls-v {
  font-size: 21px;
  font-weight: bold;
  color: var(--accent, #000080);
  line-height: 1.1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.xls-l { font-weight: bold; font-size: 11px; margin-bottom: 3px; }
.xls-n { color: #404040; font-size: 11px; line-height: 1.35; }

/* ------------------------------------------------------------
   Sections
   ------------------------------------------------------------ */
.xls-section { margin-bottom: 16px; }
.xls-h {
  font-weight: bold;
  font-size: 12px;
  border-bottom: 1px solid #808080;
  box-shadow: 0 1px 0 #fff;
  padding-bottom: 4px;
  margin-bottom: 7px;
}
.xls-sub { color: #404040; margin-bottom: 10px; line-height: 1.5; font-size: 11px; }

/* ------------------------------------------------------------
   Donut - the one SVG chart, because a slice has to be hoverable
   ------------------------------------------------------------ */
.np-chart {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px;
  margin-bottom: 10px;
}
.np-donut-wrap {
  position: relative;
  width: 192px;
  height: 192px;
  flex: 0 0 auto;
}
.np-donut { width: 192px; height: 192px; display: block; }
.np-donut .arc {
  fill: none;
  stroke-width: 34;
  cursor: pointer;
  transition: stroke-width .12s steps(3), opacity .12s,
              stroke-dasharray .9s cubic-bezier(.2,.7,.3,1);
}
.np-donut .arc:hover,
.np-donut .arc.on { stroke-width: 42; }
.np-donut.has-focus .arc:not(.on):not(:hover) { opacity: .45; }
.np-donut .ring { fill: none; stroke: #000; stroke-width: 1; }

.np-readout {
  position: absolute;
  inset: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}
.np-readout .r-v {
  font-size: 23px;
  font-weight: bold;
  color: #000;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.np-readout .r-l { font-size: 10px; color: #404040; line-height: 1.25; margin-top: 2px; }

.np-key { flex: 1; min-width: 230px; }
.np-key-row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 4px 6px;
  background: none;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  color: #000;
}
.np-key-row:hover, .np-key-row.on {
  background: #000080;
  color: #fff;
  border-color: #000080;
}
.np-key-row.on .k-pct, .np-key-row:hover .k-pct { color: #fff; }
.np-key-sw {
  width: 12px; height: 12px;
  border: 1px solid #000;
  flex: 0 0 auto;
}
.np-key-row .k-l { flex: 1; }
.np-key-row .k-v { font-variant-numeric: tabular-nums; }
.np-key-row .k-pct {
  flex: 0 0 48px;
  text-align: right;
  font-weight: bold;
  color: #000080;
  font-variant-numeric: tabular-nums;
}

/* the 50% dither Win95 used for a screened-out or inactive fill */
.dither {
  background-image: repeating-conic-gradient(#fff 0 25%, transparent 0 50%);
  background-size: 4px 4px;
}

/* ------------------------------------------------------------
   Segmented progress rows
   ------------------------------------------------------------ */
.xls-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
  font-size: 11px;
}
.xls-name { flex: 0 0 36%; }
.xls-track { flex: 1; height: 19px; padding: 2px; overflow: hidden; }
.xls-fill {
  display: block;
  height: 100%;
  width: 0%;
  background-color: var(--accent, #000080);
  background-image: repeating-linear-gradient(90deg, transparent 0 8px, #fff 8px 10px);
  background-repeat: repeat-x;
  transition: width .9s cubic-bezier(.2,.7,.3,1);
}
.xls-val {
  flex: 0 0 82px;
  text-align: right;
  font-weight: bold;
  color: var(--accent, #000080);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------
   Lists, source note, status bar
   ------------------------------------------------------------ */
.xls-list { margin: 0; padding-left: 18px; }
.xls-list li { margin-bottom: 6px; line-height: 1.55; font-size: 12px; }
.xls-list a, .xls-source a {
  color: #000080;
  text-decoration: underline;
}
.xls-list a:visited, .xls-source a:visited { color: #551a8b; }
.xls-list a:hover, .xls-source a:hover { background: #000080; color: #fff; }

.xls-source {
  margin-top: 14px;
  padding: 7px 9px;
  background: #ffffe1;
  border: 1px solid #000;
  line-height: 1.5;
  font-size: 11px;
}

.np-status {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-top: 1px solid #fff;
}
.np-status span {
  padding: 3px 8px;
  font-size: 11px;
  border: 1px solid;
  border-color: #808080 #fff #fff #808080;
  background: #c0c0c0;
}
.np-status .grow { flex: 1; }

/* ------------------------------------------------------------
   Narrow screens
   ------------------------------------------------------------ */
@media (max-width: 760px) {
  .np-shell { margin: 10px auto; padding: 0 8px; }
  .np-body { padding: 8px; }
  .np-pane { padding: 10px; }
  .xls-tiles { grid-template-columns: repeat(2, 1fr); }
  /* the header strip squeezes the role into a column of single words when it
     has to share a phone's width, so on narrow screens it stacks instead */
  .xls-head { flex-direction: column; align-items: flex-start; gap: 3px; }
  .xls-meta { flex: none; }
  .np-tab { padding: 5px 9px 6px; font-size: 11px; }
  .np-tab[aria-selected="true"] { padding: 6px 10px 8px; }
  .np-chart { gap: 12px; justify-content: center; }
  /* a long bar label squeezed into a third of a phone wraps to four lines and
     leaves the track a stub, so on narrow screens it gets its own line */
  .xls-row { flex-wrap: wrap; gap: 6px 8px; margin-bottom: 11px; }
  .xls-name { flex: 0 0 100%; }
  .xls-track { flex: 1 1 auto; }
  .xls-val { flex: 0 0 56px; }
  .np-menubar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .xls-fill { transition: none; }
  .np-donut .arc { transition: none; }
}
