/* The desk (/desk, design Live/Desk, a founder approved it 25 Nov). Linked by desk.html only. Each block below is one
   master of Components/Desk: the Level chip, the Kind chip, the Step mark, the Points, the Holders, the Lease timer and
   the Step card B; the page around them is Live/Desk. Colours are the tokens of site.css (color.level.* among them). */

.desk { display: flex; flex-direction: column; gap: 28px; padding: var(--spacing-64) var(--gutter) 88px; }

/* ---- The head: the title and lead, and the live total at the right ---- */
.dk-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px; }
.dk-head-text { display: flex; flex-direction: column; gap: 12px; max-width: 760px; min-width: 0; }
.dk-head h1 { font: 400 44px/1.25 var(--serif); letter-spacing: -0.5px; }
.dk-lead { font: 400 22px/1.45 var(--serif); color: var(--color-ink-secondary); }
.dk-total { display: flex; flex-direction: column; gap: 4px; min-width: 234px; padding: 14px 18px; border: 1px solid var(--color-rule); border-radius: var(--radius-8); background: var(--color-surface-raised); }
.dk-total-label { font: 400 12px/1.4 var(--sans); color: var(--color-ink-meta); }
.dk-total-value { font: 500 28px/1.32 var(--mono); color: var(--color-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dk-total-sub { font: 400 11px/1.36 var(--mono); color: var(--color-ink-meta); }
.dk-total-stale { font: 400 11px/1.36 var(--mono); color: var(--color-ink-muted); } /* the fleet's own write time, only past five minutes (words of 27 Nov, board pending) */
.dk-total-sub time, .dk-total-stale time { font: inherit; color: inherit; }

/* ---- The filters: Level, Kind, Free only, and the sort ---- */
.dk-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 14px 0; border-top: 1px solid var(--color-rule); border-bottom: 1px solid var(--color-rule); }
.dk-filter { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dk-filter > span:last-child { display: flex; flex-wrap: wrap; gap: 6px; }
.dk-filter-label { font: 500 12px/1.25 var(--sans); color: var(--color-ink-meta); }
.dk-filters button.dk-level, .dk-filters button.dk-kind { cursor: pointer; }
/* A filter picked: its chip is ringed in ink; the chips not picked step back. */
.dk-filters.is-picking button[aria-pressed='false'] { opacity: 0.45; }
.dk-filters button[aria-pressed='true'] { box-shadow: 0 0 0 1.5px var(--color-ink); }
/* Free only: the Plain toggle (Components/Core, master 32383509abe2bd6f), a 35 px pill with a 28 by 16 track; on, the track and the label are ink. */
.dk-free { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 35px; padding: 0 12px; border: 1px solid var(--color-rule-strong); border-radius: var(--radius-full); background: none; font: 500 13px/1.23 var(--sans); color: var(--color-ink-secondary); white-space: nowrap; cursor: pointer; }
.dk-free-track { display: flex; align-items: center; flex: none; width: 28px; height: 16px; padding: 2px; box-sizing: border-box; border-radius: var(--radius-full); background: var(--color-rule-strong); }
.dk-free-track::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--color-surface-raised); }
.dk-free::before { content: ''; position: absolute; inset: -5px 0; } /* the pill is 35 px as drawn; a finger gets 45 */
.dk-free[aria-checked='true'] { color: var(--color-ink); }
.dk-free[aria-checked='true'] .dk-free-track { justify-content: flex-end; background: var(--color-ink); }
.dk-free[aria-checked='true'] .dk-free-track::after { background: var(--color-surface); }

/* ---- Level chip (Components/Desk, master e253ceca53250427) ---- */

/* ---- Kind chip (master d08044ad5d7a03c7) ---- */

/* ---- Step mark (master 3e65ba3483de642b): main line is neutral, ink outline and an arrow; answer unknown is dashed ---- */
.dk-mark { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 6px; border: 1px solid var(--color-ink); border-radius: var(--radius-full); font: 600 12px/1.25 var(--sans); color: var(--color-ink); white-space: nowrap; }
.dk-mark.is-unknown { border: 1px dashed var(--color-ink-faint); font-weight: 500; font-style: italic; color: var(--color-ink-muted); }

/* ---- The grid: equal-height rows, three columns from 1180 px, two from 640 px, one on a phone ---- */
.dk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
@media (max-width: 1179px) { .dk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .dk-grid { grid-template-columns: minmax(0, 1fr); } }
/* The divider between what a newcomer can take and the work in progress (ui-lab pequalnp_desk_listing_1127, round 73): a row of
   the grid from edge to edge, so a short last row before it keeps its columns and the work in progress starts at the first one.
   Its label, then a 1 px rule to the right edge; 8 px more than the grid's gap above it, the gap below. */
.dk-divider { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; min-width: 0; padding-top: 8px; font: 600 12px/1.25 var(--sans); color: var(--color-ink-muted); }
.dk-divider::after { content: ''; flex: 1 0 0; height: 1px; background: var(--color-rule); }

/* ---- Step card B (master ea94bf0f833e07ba) ---- */
.dk-card { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-width: 0; padding: 18px 20px 16px; border: 1px solid var(--color-rule); border-radius: var(--radius-8); background: var(--color-surface-raised); }
.dk-card.s-you { border: 1.5px solid var(--color-public-ink); padding: 17.5px 19.5px 15.5px; }
/* A unit that cannot be leased now (the non-leasable states: full-listed, waiting-check, resting, paused, held-twin): the page's
   own colour under the card, the title and the number stepped back. No opacity, so every text keeps its contrast. */
.dk-card.is-dim { background: var(--color-surface); }
.is-dim .dk-title { color: var(--color-ink-secondary); } .is-dim .dk-pts-value { color: var(--color-ink-muted); }
.dk-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* The top row as the board draws it (Step card B, ui-lab pequalnp_desk_age_side_1127): at the left the chips and, 6 px under
   them, the "Age + side" line (Unit age, Side tag); at the right the number and the line under it. The left column gives way to
   the right one, so where the two do not fit side by side the chips wrap, the kind under the level, as on the board (the design
   seat, 27 Nov: the board wins over the site's one line of chips). Chips on one line: the row is as tall as the number and its
   line (55.76 px), with an age or without. Chips wrapped: 71 px with an age (level, kind, age). */
.dk-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dk-lead { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.dk-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; } /* a side tag that does not fit beside the age goes under it */

/* Points (master dbdc0b45722e88c4): the number, "pts" set high beside it, and what the number is doing. */
.dk-points { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.dk-pts-line { display: flex; align-items: flex-start; gap: 4px; }
.dk-pts-value { font: 500 28px/1.32 var(--mono); color: var(--color-ink); font-variant-numeric: tabular-nums; }
.dk-pts-unit { font: 400 12px/1.4 var(--sans); color: var(--color-ink-meta); }
.dk-pts-state { display: flex; align-items: center; gap: 4px; min-height: 1.4em; font: 400 12px/1.4 var(--sans); color: var(--color-ink-meta); white-space: nowrap; } /* the line keeps its height where a dimmed card leaves it empty */
.s-you .dk-pts-state, .s-checking .dk-pts-state, .s-waiting-check .dk-pts-state { color: var(--color-status-in-work-ink); }
.s-checked .dk-points * { color: var(--color-result-checked-ink); }
.s-refuted .dk-pts-value, .s-refuted .dk-pts-state { color: var(--color-status-refuted-ink); } .s-withdrawn .dk-pts-value { color: var(--color-ink-faint); }
.dk-live { width: 6px; height: 6px; border-radius: 50%; background: var(--color-public-ink); }

.dk-title-block { display: flex; flex-direction: column; gap: 8px; }
.dk-title { font: 400 22px/1 var(--serif); color: var(--color-ink); overflow-wrap: anywhere; }
.s-full .dk-title, .s-others .dk-title, .s-next .dk-title { color: var(--color-ink-secondary); } .s-withdrawn .dk-title { color: var(--color-ink-meta); }
.dk-card.s-withdrawn { background: var(--color-surface-sunk2); }
.dk-marks { display: flex; flex-wrap: wrap; gap: 6px; }
.dk-statement-box { padding: 10px 12px; border-radius: var(--radius-6); background: var(--color-surface-sunk2); }
.dk-statement { display: block; font: 400 12px/1.33 var(--mono); color: var(--color-ink-secondary); overflow-wrap: anywhere; white-space: pre-wrap; }

.dk-bottom { display: flex; flex-direction: column; gap: 10px; }
.dk-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; padding-top: 12px; border-top: 1px solid var(--color-rule); }
.dk-id { font: 400 11px/1.36 var(--mono); color: var(--color-ink-faint); overflow-wrap: anywhere; }
.dk-status { display: inline-flex; align-items: center; padding: 7px 14px; border-radius: var(--radius-6); background: var(--color-public-wash); font: 600 13px/16px var(--sans); color: var(--color-public-ink); }
.dk-chip-checking, .dk-chip-withdrawn { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 4px 10px; border-radius: var(--radius-full); font: 600 12px/1.25 var(--sans); white-space: nowrap; }
.dk-chip-checking { background: var(--color-status-in-work-fill); color: var(--color-status-in-work-ink); }
.dk-chip-withdrawn { padding: 3px 9px; border: 1px solid var(--color-ink-faint); font-weight: 500; color: var(--color-ink-meta); }
/* The reason chip of a dimmed card, at the left where the Lease button was (Status chip, Components/Core: the neutral state
   "waiting", a clock; a proof with the checker is the in-work blue). */
.dk-why { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 9px; border: 1px solid var(--color-status-retired-stroke); border-radius: var(--radius-full); background: var(--color-status-retired-fill); font: 600 12px/1.25 var(--sans); color: var(--color-ink-muted); }
.dk-why.is-check { padding: 4px 10px; border: 0; background: var(--color-status-in-work-fill); color: var(--color-status-in-work-ink); }
.dk-why > span:last-child { min-width: 0; overflow-wrap: anywhere; } /* a long pair id breaks inside the chip, never out of the card */
.dk-why time { font: inherit; color: inherit; }
.dk-copy-line { padding: 8px 10px; border-radius: var(--radius-6); background: var(--color-surface-sunk2); font: 400 12px/1.4 var(--mono); color: var(--color-ink); overflow-wrap: anywhere; white-space: pre-wrap; user-select: all; }

/* Holders (master 754ef0b8549c52c9): the stack of who holds it, a dashed empty slot when nobody does. */
.dk-holders { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dk-holders-count { font: 400 12px/1.4 var(--sans); color: var(--color-ink-meta); }
.dk-holders.is-full .dk-holders-count { font-weight: 500; color: var(--color-ink-muted); }
.dk-holders.is-full .dk-icon { color: var(--color-ink-muted); } .dk-holders.is-you .dk-icon { color: var(--color-public-ink); }
.dk-holders.is-you .dk-holders-count { font-weight: 500; color: var(--color-public-ink); }
.s-you .dk-disc, .s-checking .dk-disc { box-shadow: 0 0 0 1.5px var(--color-public-ink); }
.dk-slot-empty { width: 22px; height: 22px; border: 1px dashed var(--color-ink-faint); border-radius: 50%; }

/* Lease timer (master 2fd0657c40db6e81): a label over a 3 px bar. */
.dk-timer { display: flex; flex-direction: column; gap: 6px; }
.dk-timer-label { font: 400 12px/1.4 var(--sans); color: var(--color-ink-secondary); }
.dk-bar { display: flex; height: 3px; border-radius: var(--radius-full); background: var(--color-rule); overflow: hidden; }
.dk-bar i { border-radius: var(--radius-full); background: var(--color-ink-muted); }
.dk-timer.t-you .dk-timer-label, .dk-timer.t-next .dk-timer-label { font-weight: 500; color: var(--color-public-ink); }
.dk-timer.t-you .dk-bar, .dk-timer.t-next .dk-bar { background: var(--color-public-wash); } .dk-timer.t-you .dk-bar i, .dk-timer.t-next .dk-bar i { background: var(--color-public-ink); }
.dk-timer.t-expired .dk-timer-label { font-weight: 500; color: var(--color-accent-deep); }
.dk-timer.t-expired .dk-bar { background: none; border-top: 1px dashed var(--color-ink-faint); height: 3px; border-radius: 0; }

/* ---- In place of cards: empty, loading, error (Live/Desk row 3); each takes one card's place ---- */
.dk-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 364px; padding: 32px; border-radius: var(--radius-8); text-align: center; }
.dk-state h2 { font: 400 22px/1 var(--serif); color: var(--color-ink); }
.dk-state p { font: 400 13px/1.45 var(--sans); color: var(--color-ink-muted); }
.dk-empty { border: 1px dashed var(--color-rule-strong); background: var(--color-surface-raised); }
.dk-empty > .dk-icon { color: var(--color-ink-meta); }
.dk-empty.is-free { grid-column: 1 / -1; } /* Free only with nothing to take: the block is the grid's whole width (ui-lab desk-freeonly-empty) */
.dk-empty.is-free p { line-height: 1.23; }
.dk-error { border: 1px solid var(--color-status-refuted-ring); background: var(--color-status-refuted-row); }
.dk-error > .dk-icon { color: var(--color-status-refuted-mark); }
.dk-loading { align-items: stretch; justify-content: flex-start; gap: 14px; padding: 18px 20px; border: 1px solid var(--color-rule); background: var(--color-surface-raised); text-align: left; }
.dk-skel { display: block; border-radius: var(--radius-full); background: var(--color-surface-sunk2); }
.dk-skel-top, .dk-skel-foot { display: flex; justify-content: space-between; align-items: center; }
.dk-skel-foot { margin-top: auto; }
.dk-skel-chips { width: 150px; height: 23px; } .dk-skel-points { width: 70px; height: 34px; border-radius: var(--radius-4); }
.dk-skel-line { width: 300px; max-width: 100%; height: 22px; border-radius: var(--radius-4); } .dk-skel-line.short { width: 220px; }
.dk-skel-box { height: 52px; border-radius: var(--radius-4); }
.dk-skel-holders { width: 110px; height: 22px; } .dk-skel-button { width: 150px; height: 30px; border-radius: var(--radius-4); }
p.dk-loading-line { font: 400 12px/1.4 var(--sans); color: var(--color-ink-meta); }

.dk-more-row { display: flex; justify-content: center; }

/* ---- Narrow windows ---- */
@media (max-width: 1100px) { .desk { padding-top: var(--spacing-48); } }
@media (max-width: 760px) {
  .desk { gap: 20px; padding: var(--spacing-40) var(--gutter) var(--spacing-64); }
  .dk-head { gap: 20px; }
  .dk-head h1 { font-size: 32px; letter-spacing: -0.36px; } /* display text is 400 (Ami 26 Nov 23:2xZ); the export drew 700 */
  .dk-lead { font-size: 17px; }
  .dk-total { flex: 1 1 100%; }
  .dk-filters { gap: 10px 16px; }
  .dk-filters { justify-content: center; } .dk-filter { flex: 1 1 100%; flex-wrap: wrap; } .dk-filter > span:last-child { display: contents; } /* the label wraps with its chips (Live/Desk 390) */
  .dk-state { min-height: 320px; }
}

/* Below 360 px a card is too narrow for the chips beside a long line under the number: there the line may break, so nothing leaves the card. */
@media (max-width: 359px) { .dk-pts-state { white-space: normal; text-align: right; } }

/* The card a link names (/desk#<id>, from the P = NP home's desk panel): marked in the public blue. */
.dk-card.is-target { box-shadow: 0 0 0 2px var(--color-public-ink); }
