/**
 * ZynoStack Workroom.
 *
 * ── THE TOKENS ARE ZYNOSTACK'S, NOT THE CATALOGUE'S ─────────────────────────
 *
 * Digital Umbrella's products are dark and blue. This is a ZynoStack tool: warm
 * paper, one brass accent, near-black ink. Four fixed values were given, accent
 * #c97a00, ink #15171a, paper #fdfcf8, background #f1ede4, and everything else
 * below is derived from them and then MEASURED. No value here was chosen by
 * eye.
 *
 * ── EVERY RATIO, COMPUTED ───────────────────────────────────────────────────
 *
 * WCAG 2.1 contrast, by `tests/web-design.test.js`, which recomputes each pair
 * from this file and fails the build if one drops. Floors: 4.5 for text of any
 * size (the product uses no large-text exemption), 3.0 for a control boundary
 * or a focus ring.
 *
 *   TEXT                       on --paper   on --bg   on --surface
 *   --ink        #15171a          17.49       15.37       14.29
 *   --ink-2      #4a4f57           8.03        7.06        6.56
 *   --ink-3      #5c6167           6.09        5.35        4.97
 *   --accent-ink #8a5400           6.11        5.37        4.99
 *   --good       #17673a           6.73        5.92        5.50
 *   --warn       #8a5a00           5.77        5.07        4.72
 *   --bad        #a01a12           7.72        6.78        6.30
 *
 *   TEXT ON A TINTED CHIP      --accent-tint  --good-tint  --warn-tint  --bad-tint
 *   --ink        #15171a           14.63        15.16        15.20        13.94
 *   its own ink (accent/good/warn/bad)
 *                                   5.11         5.83         5.02         6.15
 *
 *   CONTROL BOUNDARIES AND THE RING (floor 3.0)
 *   --edge  #7f7a6d on --paper 4.17, --bg 3.66, --surface 3.40,
 *                   --accent-tint 3.49, --good-tint 3.61, --warn-tint 3.62,
 *                   --bad-tint 3.32 (the lowest of the seven)
 *   --ring  #8a5400 on --paper 6.11, --bg 5.37, --surface 4.94
 *   --accent-deep #a06100, the border of a filled accent button,
 *                   on --paper 4.87, --bg 4.27, --surface 3.97
 *
 *   FILLS
 *   --ink on --accent 5.36   |   --paper on --ink 17.49
 *
 * TWO VALUES THAT ARE DELIBERATELY NOT USED AS TEXT:
 *
 *   --accent #c97a00 measures 3.26 on paper and 2.87 on the background. It is a
 *   FILL, a rule and a bar, never a letter. Accent-coloured text is
 *   --accent-ink. This is the one mistake this palette invites, and the design
 *   check fails on `color:var(--accent)`.
 *
 *   --line #ded8c9 measures 1.38. It separates regions and MUST NOT border an
 *   interactive control, which needs 3.0: that is --edge. Five of the ten live
 *   accessibility failures in the catalogue were this one confusion.
 *
 * SURFACE SEPARATION is the weak point of a warm-paper palette and is stated
 * rather than hidden: --bg to --paper is only 1.138 and --bg to --surface
 * 1.076. Neither reads as a boundary on its own, so every card, column and
 * panel also draws a 1px --line rule. Remove the rule and the layout dissolves.
 *
 * No external resource of any kind: no font file, no icon set, no image. The
 * page's own Content-Security-Policy allows none, so anything added here that
 * fetches would fail silently rather than 404 visibly.
 */

:root {
  /* ground */
  --bg: #f1ede4;
  --paper: #fdfcf8;
  --surface: #eae5d9;

  /* ink */
  --ink: #15171a;
  --ink-2: #4a4f57;
  --ink-3: #5c6167;

  /* accent: brass */
  --accent: #c97a00;
  --accent-deep: #a06100;
  --accent-ink: #8a5400;
  --on-accent: #15171a;
  --accent-tint: #f6e6cc;

  /* boundaries */
  --line: #ded8c9;
  --edge: #7f7a6d;
  --ring: #8a5400;

  /* states */
  --good: #17673a;
  --good-tint: #dff0e4;
  --warn: #8a5a00;
  --warn-tint: #f8ebcf;
  --bad: #a01a12;
  --bad-tint: #fadcd9;

  /* type. System stack: no font is downloaded, so the first paint is the only
     paint and there is no reflow when a webfont arrives. */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --t-page: 1.5rem;
  --t-h2: 1.125rem;
  --t-body: 0.9375rem;
  --t-small: 0.8125rem;
  --t-label: 0.75rem;

  /* spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;

  /* radius. Containers soften, the instrument stays square. */
  --r: 3px;
  --r-pill: 999px;

  /* control metrics. 44px is the touch target floor and applies to every
     control, including the ones only ever clicked with a mouse: a board is read
     on a phone on the way to a meeting. */
  --ctl-h: 44px;
  --maxw: 1180px;

  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font: var(--t-body)/1.5 var(--font);
  min-height: 100vh;
}

/* The `hidden` attribute is only a UA-stylesheet `display:none`, so any author
   rule that sets display beats it at any specificity and the element simply
   stays on screen with no error. One `!important` here kills that whole family;
   per-selector patches grow one selector at a time and never finish. */
[hidden] { display: none !important; }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: var(--t-page); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-body); }

a { color: var(--accent-ink); }
a:hover { color: var(--ink); }

/* One ring, everywhere, and it is replaced rather than removed: a rule that
   strips the outline without offering anything back strands every keyboard
   user, and there is no way to see that in a screenshot. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--r);
}

.skip {
  position: absolute;
  left: -9999px;
  top: var(--s-2);
  background: var(--paper);
  color: var(--ink);
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  z-index: 40;
}
.skip:focus { left: var(--s-4); }

/* -- header ---------------------------------------------------------------- */

.top {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  border-top: 3px solid var(--accent);
}
.top-in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-3) var(--s-4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
}
.brand {
  font-size: var(--t-body);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-right: auto;
  text-decoration: none;
  color: var(--ink);
}
.brand span { color: var(--ink-3); font-weight: 400; }
.brand:hover { color: var(--ink); }

.who {
  font-size: var(--t-small);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--s-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
}
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--ctl-h);
  padding: 0 var(--s-3);
  color: var(--ink-2);
  text-decoration: none;
  font-size: var(--t-small);
  font-weight: 600;
  border-bottom: 3px solid transparent;
}
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* -- shell ----------------------------------------------------------------- */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-5) var(--s-4) var(--s-6);
}

.head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.head p { color: var(--ink-2); font-size: var(--t-small); }
/* A control sharing the heading row sits at the far end and on its own
   baseline, not on the heading's. */
.head .field { margin-left: auto; align-self: end; }

.sub { color: var(--ink-2); font-size: var(--t-small); }
.muted { color: var(--ink-3); font-size: var(--t-small); }

/* -- controls -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--ctl-h);
  padding: 0 var(--s-4);
  font: 600 var(--t-small)/1 var(--font);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--edge);
  border-radius: 0;
  cursor: pointer;
}
.btn:hover { background: var(--surface); }
.btn[disabled] { cursor: not-allowed; color: var(--ink-3); background: var(--surface); }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent-deep);
  border-bottom-width: 3px;
}
.btn-primary:hover { background: var(--accent-deep); color: var(--paper); }

.btn-quiet { background: transparent; border-color: var(--edge); }
.btn-quiet:hover { background: var(--surface); }

.btn-danger { color: var(--bad); border-color: var(--edge); }
.btn-danger:hover { background: var(--bad-tint); color: var(--bad); }

/* -- fields ---------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: var(--s-1); }
.field > label {
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.field input,
.field select,
.field textarea {
  min-height: var(--ctl-h);
  padding: var(--s-2) var(--s-3);
  font: var(--t-body)/1.4 var(--font);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  width: 100%;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-3); opacity: 1; }
.field .hint { font-size: var(--t-label); color: var(--ink-3); }
/* A single control standing on its own in a panel. Stretched to the full
   width of the page it reads as a search box for everything, not as a filter
   on the board beneath it. */
.field-narrow { max-width: 320px; }

.check {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--ctl-h);
  font-size: var(--t-small);
  color: var(--ink-2);
}
.check input { width: 20px; height: 20px; accent-color: var(--accent-deep); }

/* Fields align at the TOP so their labels line up, and the submit button takes
   a row of its own. Bottom-aligning them instead lined the inputs up with the
   bottom of whichever field happened to carry a hint, which made a tidy form
   look like a mistake. */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--s-3);
  align-items: start;
}
.form-grid > .btn { grid-column: 1 / -1; justify-self: start; }
/* A checkbox has no label above it, so left at the top of its cell it floats
   a line higher than every input beside it. */
.form-grid > .check { align-self: end; }

/* -- surfaces -------------------------------------------------------------- */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-4);
}
.card + .card { margin-top: var(--s-3); }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-4);
  margin-bottom: var(--s-5);
}
.panel > h2 { margin-bottom: var(--s-3); }
/* The board comes first on this page, so the panel beneath it needs the space
   above that the board's own margin does not provide. */
.panel-top { margin-top: var(--s-5); }

.empty {
  background: var(--paper);
  border: 1px dashed var(--edge);
  border-radius: var(--r);
  padding: var(--s-6) var(--s-4);
  text-align: center;
  color: var(--ink-2);
}
.empty strong { display: block; color: var(--ink); margin-bottom: var(--s-1); }

.notice {
  border: 1px solid var(--edge);
  border-left-width: 4px;
  border-radius: var(--r);
  padding: var(--s-4);
  background: var(--warn-tint);
  color: var(--ink);
  margin-bottom: var(--s-5);
}
.notice h2 { margin-bottom: var(--s-2); }
.notice code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--t-small);
}

/* -- chips ----------------------------------------------------------------- */

/* A chip always carries its own word. Colour is a second signal and never the
   only one: on a monochrome screen, or to anyone who does not separate red from
   green, the label is what is left. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 2px var(--s-2);
  border-radius: var(--r-pill);
  border: 1px solid var(--edge);
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--surface);
  color: var(--ink-2);
}
.chip-doing { background: var(--accent-tint); color: var(--accent-ink); }
.chip-blocked { background: var(--bad-tint); color: var(--bad); }
.chip-done { background: var(--good-tint); color: var(--good); }
.chip-high { background: var(--warn-tint); color: var(--warn); }
.chip-overdue { background: var(--bad-tint); color: var(--bad); }
.chip-soon { background: var(--warn-tint); color: var(--warn); }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--edge);
  color: var(--ink-2);
  font-size: var(--t-label);
  font-weight: 700;
  flex: none;
}

/* -- lists ----------------------------------------------------------------- */

.rows { list-style: none; display: flex; flex-direction: column; gap: var(--s-2); }
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-3) var(--s-4);
  min-height: var(--ctl-h);
  font: var(--t-body)/1.4 var(--font);
  /* A row is a surface you press, not a sentence with a link in it, so it
     takes the body's ink and drops the underline the anchor rule gives it. */
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.row:hover { background: var(--surface); color: var(--ink); }
.row:hover .row-title { text-decoration: underline; }
.row-main { flex: 1 1 260px; min-width: 0; }
.row-title { font-weight: 600; }
.row-meta { color: var(--ink-2); font-size: var(--t-small); }
.row-tags { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }

table { border-collapse: collapse; width: 100%; font-size: var(--t-small); }
caption { text-align: left; color: var(--ink-2); padding-bottom: var(--s-2); }
th, td {
  text-align: left;
  padding: var(--s-3);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
thead th {
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--surface);
}
/* A row header is DATA that happens to name its row. Given the column-header
   treatment it shouts a person's name in tracked capitals, which reads as a
   heading rather than as the row it labels. */
th[scope="row"] { font-weight: 600; color: var(--ink); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }

/* -- the board ------------------------------------------------------------- */

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-3);
  align-items: start;
}
.col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-2);
  min-width: 0;
}
.col > h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: var(--s-2);
}
.col-n { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.col ul { list-style: none; display: flex; flex-direction: column; gap: var(--s-2); }
.col .kids { margin: var(--s-2) 0 0 var(--s-4); border-left: 2px solid var(--line); padding-left: var(--s-2); }

.task {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--edge);
  border-radius: var(--r);
  padding: var(--s-3);
  font: var(--t-body)/1.35 var(--font);
  color: var(--ink);
  cursor: pointer;
}
.task:hover { background: var(--accent-tint); }
.task-title { font-weight: 600; }
.task-line {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
  margin-top: var(--s-2);
  font-size: var(--t-small);
  color: var(--ink-2);
}
.task-of { font-size: var(--t-label); color: var(--ink-3); }
.task-overdue { border-left-color: var(--bad); }
.task-soon { border-left-color: var(--warn); }
/* --accent-deep rather than --accent: the marker sits between the card
   (--paper) and the column ground (--surface), where full-strength accent
   measures only 2.67 against the darker of the two. The chip beside the title
   is the signal that actually carries; this edge only has to be visible. */
.task-high { border-left-color: var(--accent-deep); }

/* -- the side panel -------------------------------------------------------- */

/* A native <dialog> opened with showModal(). The focus trap, the inert page
   behind it and Escape are the browser's, which is both less code and more
   correct than a hand-rolled trap that has to be right in every browser. */
dialog {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--ink);
  max-width: none;
  max-height: none;
}
dialog::backdrop { background: rgba(21, 23, 26, 0.45); }

.side {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(480px, 100%);
  height: 100%;
  background: var(--paper);
  border-left: 1px solid var(--edge);
  display: flex;
  flex-direction: column;
}
.side-top {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  border-bottom: 1px solid var(--line);
}
.side-top h2 { flex: 1; min-width: 0; }
.side-body { flex: 1; overflow-y: auto; padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-4); }
/* One column in a 480px panel. The page's auto-fit grid gives two here, and a
   half-width date field beside a half-width title is harder to fill in than
   either would be on its own. */
.side .form-grid { grid-template-columns: minmax(0, 1fr); }
.side-foot { padding: var(--s-4); border-top: 1px solid var(--line); display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* Fields inside one form still need air between them: the side panel's own
   gap only separates its top-level children, and a form is one of those. */
.side-body form .field + .field,
.side-body form .mid + .field { margin-top: var(--s-3); }

.mid {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: var(--s-4) 0 var(--s-2);
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.mid::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.comments { list-style: none; display: flex; flex-direction: column; gap: var(--s-2); }
.comments li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-3);
  font-size: var(--t-small);
}
.comments .by { color: var(--ink-2); font-size: var(--t-label); }

.feed { list-style: none; display: flex; flex-direction: column; gap: var(--s-2); }
.feed li { font-size: var(--t-small); color: var(--ink-2); padding-left: var(--s-3); border-left: 2px solid var(--line); }
.feed time { color: var(--ink-3); font-size: var(--t-label); display: block; }

/* -- the live region ------------------------------------------------------- */

/* Both regions live in one fixed stack so an error and a save cannot land on
   top of each other. Empty regions occupy nothing, so the stack is invisible
   until there is something to say. */
.say {
  position: fixed;
  left: 50%;
  bottom: var(--s-4);
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  max-width: calc(100% - 2 * var(--s-4));
  pointer-events: none;
}
.say p {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r);
  padding: var(--s-2) var(--s-4);
  font-size: var(--t-small);
}
.say p.bad { background: var(--bad); color: var(--paper); }

/* Announced, never shown. Not `display:none`, which removes it from the
   accessibility tree along with the announcement. */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* -- narrow ---------------------------------------------------------------- */

/* The board stacks to one column. Four columns squeezed into 400px is four
   unreadable columns, and a horizontally scrolling board hides the two columns
   that matter most on the day something is blocked. */
@media (max-width: 860px) {
  .board { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 460px) {
  main { padding: var(--s-4) var(--s-3) var(--s-5); }
  .top-in, .nav { padding-left: var(--s-3); padding-right: var(--s-3); }
  h1 { font-size: 1.25rem; }
  .head .field { margin-left: 0; flex: 1 1 100%; max-width: none; }
  .side { width: 100%; }
  /* Form buttons go full width because they end a stacked column of fields and
     a narrow button under a wide field reads as unfinished. The header's
     buttons deliberately do NOT: a full-width bar there pushes the first task
     off the screen, which is the whole page on a phone. */
  .side-foot .btn, .form-grid .btn { width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .row, .task, .nav a { transition: background-color 120ms ease; }
}
