/* 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); }

/* ---- The filters: Level, Kind, 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); }

/* ---- 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); } }

/* ---- 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; }
.dk-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* The chips and the number share a row; the line under the number has the card's whole width, so it never squeezes the chips. */
.dk-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 2px 12px; }
.dk-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }

/* Points (master dbdc0b45722e88c4): the number, "pts" set high beside it, and what the number is doing. */
.dk-points { display: contents; }
.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 { grid-column: 1 / -1; justify-self: end; display: flex; align-items: center; gap: 4px; font: 400 12px/1.4 var(--sans); color: var(--color-ink-meta); white-space: nowrap; }
.s-you .dk-pts-state, .s-checking .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); }
.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-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; }
}

/* 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); }
