/* ===========================================================================
   Assent

   Written once, from tokens. If something needs changing, change the token --
   there are deliberately no overrides further down, because that is how the
   last stylesheet ended up with six corner radii and three button heights.

   The rules, written down so they can be checked rather than eyeballed:

     Space    only 4 8 12 16 24 32 48
     Type     only 11 12.5 13.5 15 19 26
     Weight   400 and 500, 600 for headings
     Radius   two: 10px controls, 16px panels
     Height   controls 36px, rows 60px
     Colour   greyscale chrome, one green, one amber, one red.
              The project's colour is the loud thing, and the only loud thing.
   ========================================================================= */

:root {
  --bg:      #f4f3f9;
  --surface: #ffffff;
  --sunk:    #edecf3;
  --hair:    #e8e6ef;

  --ink:   #16151d;
  --ink-2: #62606f;
  --ink-3: #9896a6;

  --go:        #10b981;
  --go-tint:   #e3f9f1;
  --go-ink:    #07694a;
  --wait:      #ff8a3d;
  --wait-tint: #fdeee0;
  --wait-ink:  #a1520d;
  --bad:       #dc2b55;
  --bad-tint:  #fce8ed;
  --bad-ink:   #9c1236;

  /* set per page, from the project */
  --proj: #10b981;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  --r-control: 10px;
  --r-panel:   16px;
  --h-control: 36px;

  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --page: 660px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; }

:focus-visible {
  outline: 2px solid var(--proj);
  outline-offset: 2px;
  border-radius: var(--r-control);
}

/* --------------------------------------------------------------- top bar */

.topbar { background: var(--surface); border-bottom: 1px solid var(--hair); }

.topbar-in {
  max-width: var(--page);
  margin: 0 auto;
  height: 52px;
  padding: 0 var(--s5);
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  flex: none;
}

.mark { flex: none; }

.crumb {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crumb::before { content: "/"; color: var(--ink-3); flex: none; }
.crumb:hover { color: var(--ink); }

.me { margin-left: auto; flex: none; }
.me img { border-radius: 50%; }

/* ------------------------------------------------------------ title block */

.band { background: var(--proj); color: #fff; }

.band-in,
.head {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--s5);
  display: grid;
  gap: var(--s2);
  justify-items: start;
}

.head { padding-bottom: var(--s3); }

.band h1,
.head h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.band p { margin: 0; font-size: 13.5px; opacity: 0.85; }
.head p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

.band-chip,
.head-chip { display: flex; align-items: center; gap: var(--s2); }

/* ------------------------------------------------------------------ page */

.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--s5) var(--s5) var(--s7);
}

body.bare .page {
  max-width: 400px;
  min-height: 80vh;
  display: grid;
  align-content: center;
}

.stack { display: grid; gap: var(--s4); }
.stack.tight { gap: var(--s2); }

.centre { display: grid; gap: var(--s5); justify-items: center; text-align: center; }
.centre .stack { width: 100%; text-align: left; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.025em; }

.lede { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--ink-2); }

.label,
.meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- panels */

.card,
.panel {
  background: var(--surface);
  border-radius: var(--r-panel);
  overflow: hidden;
}

.empty { padding: var(--s5); color: var(--ink-2); font-size: 13.5px; }

/* ------------------------------------------------------------------ rows */

.rows { display: grid; }

.row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 60px;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--hair);
  text-decoration: none;
}

.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--sunk); }

.nm { display: grid; gap: 2px; min-width: 0; }
.nm strong { font-size: 13.5px; font-weight: 500; letter-spacing: -0.01em; }
.nm span { font-size: 11.5px; color: var(--ink-3); }

.end { margin-left: auto; flex: none; display: flex; align-items: center; gap: var(--s1); }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.face { border-radius: 50%; flex: none; }

.ft {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: var(--r-control);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}

.ft.aud { background: #ff8a3d; }
.ft.img { background: #ff5a8a; }
.ft.doc { background: #7c5cff; }
.ft.vid { background: #10b981; }

/* ----------------------------------------------------------------- tiles */

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
@media (min-width: 620px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.tile {
  border-radius: var(--r-panel);
  padding: var(--s4);
  min-height: 96px;
  display: grid;
  gap: var(--s2);
  align-content: space-between;
  min-width: 0;
  text-decoration: none;
}

.tile strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile .n { font-size: 11.5px; opacity: 0.85; }

.tile.new {
  background: var(--surface);
  color: var(--ink-3);
  place-items: center;
  align-content: center;
  gap: var(--s1);
}

.tile.new strong { font-size: 19px; }

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

.btn {
  height: var(--h-control);
  padding: 0 var(--s4);
  border: 0;
  border-radius: var(--r-control);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn.go     { background: var(--go);   color: #fff; }
.btn.proj   { background: var(--proj); color: #fff; }
.btn.danger { background: var(--bad);  color: #fff; }
.btn.quiet  { background: transparent; color: var(--ink-2); }
.btn.quiet:hover { background: var(--sunk); color: var(--ink); }
.btn.bad-quiet { background: transparent; color: var(--bad); }
.btn.bad-quiet:hover { background: var(--bad-tint); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn svg { width: 15px; height: 15px; flex: none; }

/* Full width only where it is the one thing to do on the page. */
.stack > .btn,
.stack > form > .btn { width: 100%; }

.acts { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.acts .btn { width: auto; }
.acts form { display: contents; }
.acts .spacer { flex: 1; min-width: var(--s3); }

.chip {
  height: 24px;
  padding: 0 var(--s3);
  border: 0;
  border-radius: 999px;
  background: var(--sunk);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.chip.go   { background: var(--go-tint);   color: var(--go-ink); }
.chip.wait { background: var(--wait-tint); color: var(--wait-ink); }

.textlink {
  border: 0;
  background: none;
  padding: 0;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  justify-self: start;
}

.textlink:hover { color: var(--ink); }
.textlink svg { width: 15px; height: 15px; flex: none; }

.del {
  margin-left: auto;
  color: var(--ink-3);
  text-decoration: none;
  font-size: 16px;
  line-height: 1;
  padding: 0 var(--s1);
  border-radius: var(--s1);
}

.del:hover { color: var(--bad); background: var(--bad-tint); }

/* ----------------------------------------------------------------- inputs */

.input {
  background: var(--surface);
  border-radius: var(--r-control);
  padding: var(--s2) var(--s3);
  display: grid;
  gap: 2px;
}

.input .lab {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.input input,
.input select,
.input textarea {
  border: 0;
  background: transparent;
  padding: 0;
  width: 100%;
  font-family: var(--sans);
  font-size: 16px; /* under 16 and iOS zooms the page on focus */
  font-weight: 500;
  color: var(--ink);
  resize: vertical;
}

.input input::placeholder,
.input textarea::placeholder { color: var(--ink-3); font-weight: 400; }
.input :focus { outline: none; }
.input:focus-within { outline: 2px solid var(--proj); outline-offset: 2px; }
.input input[type="file"] { font-size: 13.5px; font-weight: 400; }

.problem {
  margin: 0;
  background: var(--bad-tint);
  color: var(--bad-ink);
  border-radius: var(--r-control);
  padding: var(--s3);
  font-size: 13.5px;
}

/* ---------------------------------------------------------------- pickers */

.swatches { display: flex; flex-wrap: wrap; gap: var(--s2); }

.sw {
  width: 32px;
  height: 32px;
  border-radius: var(--r-control);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
}

.sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sw span[aria-hidden] { color: #fff; font-size: 14px; font-weight: 600; opacity: 0; }
.sw:has(input:checked) span[aria-hidden] { opacity: 1; }
.sw:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.picks { display: grid; gap: var(--s2); }

.pick {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 52px;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-control);
  background: var(--surface);
  cursor: pointer;
}

.pick:has(input:checked) { background: var(--go-tint); }
.pick .who { display: grid; gap: 1px; min-width: 0; }
.pick .who strong { font-size: 13.5px; font-weight: 500; }
.pick .who span { font-size: 11.5px; color: var(--ink-3); }
.pick .end { margin-left: auto; }
.pick form { display: contents; }

.addrow {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 52px;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-control);
  background: var(--surface);
}

.addrow input {
  border: 0;
  background: transparent;
  flex: 1;
  min-width: 0;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
}

.addrow input:focus { outline: none; }

.switchrow {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 60px;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-panel);
  background: var(--surface);
  cursor: pointer;
}

.switchrow .st { display: grid; gap: 2px; min-width: 0; }
.switchrow .st strong { font-size: 13.5px; font-weight: 500; }
.switchrow .st span { font-size: 11.5px; color: var(--ink-3); }
.switchrow input { margin-left: auto; width: 20px; height: 20px; accent-color: var(--go); }

/* ------------------------------------------------------------------ media */

.player { display: grid; gap: var(--s2); }
.player audio { width: 100%; height: 40px; }
.player video { width: 100%; border-radius: var(--r-panel); background: #000; }

.shot { border-radius: var(--r-panel); overflow: hidden; background: var(--surface); }
.shot img { width: 100%; height: auto; }
.shot iframe { width: 100%; height: 64vh; border: 0; display: block; }

.shot.nopreview {
  padding: var(--s6);
  display: grid;
  gap: var(--s3);
  place-items: center;
  text-align: center;
  color: var(--ink-2);
  font-size: 13.5px;
}

/* ---------------------------------------------------------------- verdict */

.verdict {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  padding: var(--s4);
  border-radius: var(--r-panel);
  background: var(--wait-tint);
}

.verdict.done { background: var(--go-tint); }
.verdict > div { display: grid; gap: 2px; }
.verdict .vt { font-size: 13.5px; font-weight: 600; letter-spacing: -0.015em; }
.verdict .vs { font-size: 11.5px; color: var(--ink-2); }

.verdict .mark2 {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  background: var(--wait);
  color: #fff;
}

.verdict.done .mark2 { background: var(--go); }

/* -------------------------------------------------------------------- ask */

.ask {
  background: var(--surface);
  border-radius: var(--r-panel);
  padding: var(--s4);
  display: grid;
  gap: var(--s3);
}

.askhead { display: flex; align-items: center; gap: var(--s3); }
.askhead .t { display: grid; gap: 2px; min-width: 0; }
.askhead .t strong { font-size: 13.5px; font-weight: 600; letter-spacing: -0.015em; }
.askhead .t span { font-size: 11.5px; color: var(--ink-3); }

.quote {
  background: var(--sunk);
  border-radius: var(--r-control);
  padding: var(--s3);
  font-size: 13.5px;
  line-height: 1.5;
}

/* --------------------------------------------------------------- comments */

.composer { background: var(--surface); border-radius: var(--r-panel); overflow: hidden; }

.composer textarea {
  border: 0;
  width: 100%;
  padding: var(--s3) var(--s4);
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  resize: vertical;
  display: block;
}

.composer textarea:focus { outline: none; }

.composer .tools {
  padding: var(--s2) var(--s3);
  border-top: 1px solid var(--hair);
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.thread { display: grid; }

.cmt { display: flex; gap: var(--s3); padding: var(--s4) 0; border-top: 1px solid var(--hair); }
.cmt:first-child { border-top: 0; }
.cmt .body { display: grid; gap: var(--s1); min-width: 0; flex: 1; }
.cmt .head { display: flex; align-items: center; gap: var(--s2); padding: 0; margin: 0; max-width: none; }
.cmt .head strong { font-size: 13.5px; font-weight: 600; }
.cmt .head time { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.cmt p { margin: 0; font-size: 14px; }

.event {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) 0;
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

.event .d { width: 6px; height: 6px; border-radius: 50%; background: var(--go); flex: none; }

/* --------------------------------------------------------------- uploader */

.facepick { display: flex; align-items: center; gap: var(--s4); }
.facepick .side { display: grid; gap: var(--s2); justify-items: start; }
.photoform { display: contents; }
.btn:has(input[type="file"]) { position: relative; }
.btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.dropzone {
  border-radius: var(--r-panel);
  background: var(--surface);
  padding: var(--s6) var(--s4);
  display: grid;
  gap: var(--s2);
  justify-items: center;
  text-align: center;
  cursor: pointer;
  position: relative;
}

.dropzone.over { background: var(--go-tint); }
.dropzone strong { font-size: 15px; font-weight: 600; }
.dropzone span { font-size: 12.5px; color: var(--ink-2); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.picked {
  display: none;
  align-items: center;
  gap: var(--s3);
  background: var(--surface);
  border-radius: var(--r-panel);
  min-height: 60px;
  padding: var(--s3) var(--s4);
}

.picked.on { display: flex; }
.picked .nm { flex: 1; }

.progress { font-size: 12.5px; color: var(--ink-2); }
.progress:empty { display: none; }

.track { height: 4px; border-radius: 999px; background: var(--sunk); overflow: hidden; display: none; }
.track.on { display: block; }
.track span { display: block; height: 100%; width: 0; background: var(--proj); border-radius: 999px; }

@media (prefers-reduced-motion: no-preference) {
  .track span { transition: width 180ms ease-out; }
}

/* --------------------------------------------------------- public link */

.sharebox {
  background: var(--surface);
  border-radius: var(--r-panel);
  padding: var(--s4);
  display: grid;
  gap: var(--s3);
}

.sharehead { display: grid; gap: 2px; }
.sharehead strong { font-size: 13.5px; font-weight: 500; }
.sharehead span { font-size: 11.5px; color: var(--ink-3); }

.shareurl {
  background: var(--sunk);
  border-radius: var(--r-control);
  padding: var(--s3);
  font-family: var(--mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.sharebox .btn { justify-self: start; }

/* ------------------------------------------------------- confirm pages */

.confirm { display: grid; gap: var(--s5); }
.confirm .acts { gap: var(--s2); }

/* ---------------------------------------------------------- audio panel */

.player.audio {
  background: var(--surface);
  border-radius: var(--r-panel);
  padding: var(--s3) var(--s4);
}

/* --------------------------------------------------- file pick as button */

.filepick { position: relative; overflow: hidden; }
.filepick input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.filepick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.photoform { display: flex; gap: var(--s2); flex-wrap: wrap; }
.photoform .btn { width: auto; }

/* The public link, while it is on, reads as live rather than available. */
.btn.quiet.on { background: var(--go-tint); color: var(--go-ink); }

/* Comment controls are reached often enough to deserve a real target. */
.cmt .del {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border-radius: var(--r-control);
}

.composer .tools { padding: var(--s3) var(--s4); }
.composer .tools .btn { padding: 0 var(--s5); }
.thread { padding-top: var(--s1); }

/* ------------------------------------------------------------- approval

   The one thing a reviewer came to do. Given its own block, its own colour,
   and the full width of the column -- it used to be a button under a note,
   which read as one option among several. */

.approve {
  background: var(--go-tint);
  border-radius: var(--r-panel);
  padding: var(--s5);
  display: grid;
  gap: var(--s4);
}

.approve .askhead .t strong { font-size: 15px; }
.approve .quote { background: var(--surface); }

.approve-btn {
  width: 100%;
  height: 52px;
  background: var(--go);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--r-control);
}

.approve-btn svg { width: 18px; height: 18px; stroke-width: 2.2; }
.approve .hint { text-align: center; color: var(--go-ink); opacity: 0.75; }

/* Approved is a statement, not a chip. */
.verdict.done { padding: var(--s5); }
.verdict.done .vt { font-size: 15px; }
