/* Pyramid sort (/tools/pyramid). The tabs, buttons, banners, share and class sections come
   from network-matrix.css through the .nm wrapper; this file adds the levels editor, the notes
   list and the board, scoped to .py. Site tokens only: the pyramid is the fjord blue, notes
   that fit nowhere are the sprint red. */

.py .nm-grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
@media (max-width: 980px) { .py .nm-grid { grid-template-columns: minmax(0, 1fr); } }

.py select {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--cell);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 7px 8px;
  min-width: 0;
}
.py .btn.sm { font-size: 14px; padding: 4px 11px; }
.py .btn:disabled { opacity: 0.4; cursor: default; }
.py .btn:disabled:hover { border-color: var(--line); }
.py .add { margin-top: 16px; }
.py .add-note { margin-bottom: 16px; }
.py .add-note input { flex: 1 1 240px; }

/* levels editor */
.py .levels { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.py .lvl { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.py .lvl .head { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.py .lvl .ix { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.py .lvl .head input { width: 100%; }
.py .lvl .head .row { gap: 6px; flex-wrap: nowrap; }
.py .lvl .subs { display: flex; flex-direction: column; gap: 8px; margin-left: 94px; padding-left: 14px; border-left: 1px solid var(--line); }
.py .lvl .sub { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.py .lvl .sub input { width: 100%; font-size: 15px; }

/* notes list */
.py .notes { display: flex; flex-direction: column; gap: 8px; }
.py .nrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 210px) auto; gap: 8px; align-items: center; }
.py .nrow input, .py .nrow select { width: 100%; }

/* the board */
.py .board { border-top: 1px solid var(--line); padding-top: 16px; }
.py .tray { border: 1px dashed var(--line-2); padding: 10px 12px; margin-bottom: 16px; min-height: 48px; }
.py .tray .lab, .py .zone .lab { display: block; margin-bottom: 6px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.py .empty { font-size: 14px; color: var(--ink-soft); }
.py .hint { font-size: 14px; color: var(--ink-soft); margin: -4px 0 12px; }
.py .prow { display: grid; grid-template-columns: minmax(120px, 36%) minmax(0, 1fr); align-items: stretch; }
.py .slice { position: relative; min-height: 100px; }
.py .slice svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.py .slice .slabel {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(92%, var(--w));
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}
.py .slice .cnt { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.py .zones { display: flex; gap: 8px; padding: 6px 0 6px 12px; border-bottom: 1px solid var(--line); }
.py .prow:last-of-type .zones { border-bottom: 0; }
.py .zone {
  flex: 1 1 0;
  min-width: 0;
  display: block;
  padding: 6px 8px;
  border: 1px dashed transparent;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.py .zone:hover, .py .armed .zone { border-color: var(--line-2); }
.py .armed .zone:hover, .py .armed .zone:focus-visible { border-color: var(--slow); background: rgba(42, 92, 122, 0.06); }
.py .zchips { display: flex; flex-wrap: wrap; gap: 6px; }

/* notes on the board: white slips with a hairline, the selected one ringed in blue */
.py .note {
  font: inherit;
  font-size: 14px;
  line-height: 1.25;
  max-width: 100%;
  padding: 5px 9px;
  background: var(--cell);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 0;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.py .note:hover { border-color: var(--ink); }
.py .note .by { display: block; font-size: 12px; color: var(--ink-soft); }
.py .note[aria-pressed=true] { outline: 2px solid var(--slow); outline-offset: 1px; border-color: var(--slow); }

.py .nofit { display: grid; grid-template-columns: minmax(120px, 36%) minmax(0, 1fr); margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.py .nofit .slabel { align-self: center; text-align: center; font-size: 14px; font-weight: 600; color: var(--fast); }
.py .nofit .slabel small { display: block; font-size: 13px; font-weight: 400; color: var(--ink-soft); }

/* class view */
/* .dist is a list here; network-matrix.css also styles .dist as a single bar, so reset that */
.py .dist { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 8px 14px; align-items: center; font-size: 15px; height: auto; border: 0; background: none; }
.py .bar { height: 10px; border: 1px solid var(--line-2); background: var(--cell); }
.py .bar i { display: block; height: 100%; background: var(--slow); }
.py .dist .n { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink-soft); white-space: nowrap; }
.py .dist .subl { padding-left: 16px; color: var(--ink-soft); }
.py .cwarn { margin: 0 0 12px; font-size: 15px; color: var(--fast); max-width: 56ch; }

@media (max-width: 600px) {
  .py .lvl .head { grid-template-columns: minmax(0, 1fr) auto; }
  .py .lvl .ix { grid-column: 1 / -1; }
  .py .lvl .subs { margin-left: 0; }
  .py .nrow { grid-template-columns: minmax(0, 1fr) auto; }
  .py .nrow select { grid-column: 1 / -1; grid-row: 2; }
  .py .prow, .py .nofit { grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); }
  .py .zones { flex-direction: column; gap: 4px; padding-left: 8px; }
  .py .dist { grid-template-columns: minmax(0, 1fr) 80px; }
  .py .dist .n { grid-column: 1 / -1; margin: -4px 0 6px; }
}
