/*
 * BidRights.
 *
 * Moved out of base.html, which had grown past 400 lines and made you scroll
 * through styling to find markup. Now cached by the browser and fingerprinted
 * by WhiteNoise, so a change gets a new URL instead of sitting in someone's
 * cache for a week.
 *
 * The accent colour is still set per page. base.html writes it into
 * --accent on <body>, so a stylesheet can stay static while pages differ.
 */

:root {
  /* Paper.
   *
   * Bronze is the brand and nothing else. Green, amber and red mean paid,
   * held and needs-you, and never appear as decoration — so when something
   * on this site is coloured, it is telling you something.
   */
  --ink: #292524;
  --ink-2: #57534e;
  --muted: #8a817a;
  --line: #e5ded2;
  --line-2: #efe9de;
  --bg: #faf8f4;
  --panel: #f5f1ea;
  --card: #fffefc;
  --accent: #9a6a3a;
  --accent-soft: #f0e6d9;

  /* state, never brand */
  --paid: #15803d;
  --held: #b45309;
  --stop: #9f1239;
}
* { box-sizing: border-box; }
h1, h2, h3 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--accent); }
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { display: block; height: 26px; width: auto; }
.navlinks { display: flex; gap: 16px; font-size: 14px; }
.navlinks a { color: var(--muted); text-decoration: none; }
.navlinks a:hover { color: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.role-chip {
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px;
  background: var(--accent); color: #fff;
}
/* Left-aligned, not centred.
 *
 * The sidebar already constrains the width, so `margin: 0 auto` on top of it
 * pushed every page into the middle of what was left and opened a gap beside
 * the nav. A max-width still stops lines of prose running too long on a wide
 * screen; it just starts from the left now. */
.wrap { max-width: 1120px; margin: 0; padding: 26px; }
.wrap-narrow { max-width: 420px; margin: 0 auto; padding: 56px 24px; }

h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.02em; }
.subtitle { color: var(--muted); margin: 0 0 24px; font-size: 15px; }
.prose { font-size: 15px; }

/* --- Words people wrote ------------------------------------------------------
 *
 * `rich` is anything a person typed, run through the rich_text filter: real
 * paragraphs and real lists. The requirements in a brief are usually a list,
 * and as plain dashes they read as one grey block.
 */
.rich { font-size: 15px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.rich p { margin: 0 0 .7em; }
.rich > :last-child { margin-bottom: 0; }
.rich ul, .rich ol { margin: 0 0 .8em; padding-left: 1.4em; }
.rich li { margin: .2em 0; padding-left: .2em; }
.rich li::marker { color: var(--muted); }
.rich .lead-in { font-weight: 600; margin-bottom: .3em; }

/* The brief is the document everyone works from, so it is set like one:
 * bigger type and a line length that is comfortable to read. */
.brief { font-size: 16px; line-height: 1.7; max-width: 68ch; }
.brief-side { font-size: 14px; line-height: 1.6; }
.brief-from { margin: -4px 0 14px; font-size: 13px; color: var(--muted); }

/* Someone else's words, set apart from the page's own text and labelled with
 * who said them. Neutral on purpose: a coloured border here would be a state
 * colour used as decoration. */
.said {
  margin: 12px 0 0; padding: 12px 16px;
  background: var(--panel); border-left: 3px solid var(--line);
  border-radius: 0 8px 8px 0;
}
.said-who {
  margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.said .rich { font-size: 15px; }
.said-checks { margin: 10px 0 0; padding-left: 1.2em; font-size: 14px; color: var(--ink); }
.said-checks li { margin: .25em 0; }
/* Inside the action panel, where `.action p` would otherwise grey it out. */
.action .said { margin: 0 0 16px; max-width: 72ch; background: var(--card); }
.action .said .rich p { margin: 0 0 .7em; color: var(--ink); font-size: 15px; max-width: none; }
.action .said .rich > :last-child { margin-bottom: 0; }
.dim { color: var(--muted); }
.overdue { color: var(--stop); font-weight: 600; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; margin-bottom: 16px;
}
.card h2 { font-size: 15px; margin: 0 0 10px; }
.card .empty { color: var(--muted); font-size: 14px; margin: 0; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.stat-label { color: var(--muted); font-size: 13px; }

/* --- Tasks --- */
.task-card { padding: 16px 18px; }
.task-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.task-title { font-weight: 600; font-size: 16px; text-decoration: none; color: var(--ink); }
.task-title:hover { color: var(--accent); }
/* Two lines of the brief, clipped by the browser rather than at a word count,
 * so a card is the same height whatever the brief looks like. */
.task-desc {
  color: var(--ink-2); font-size: 14px; margin: 6px 0 10px; line-height: 1.5;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  line-clamp: 2; overflow: hidden;
}
.task-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.badge {
  font-size: 11px; font-weight: 600; color: #fff; padding: 3px 9px;
  border-radius: 99px; white-space: nowrap;
}
.file-row {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.file-row:last-child { border-bottom: 0; }
.file-group {
  margin: 14px 0 2px; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.file-group:first-of-type { margin-top: 0; }

/* Delivered work, as the thing the client paid for rather than one more row
 * in a list. Each file is one large target: the whole row downloads. */
.deliverables { display: grid; gap: 8px; }
.deliverable {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--ink); text-decoration: none;
}
.deliverable:hover { border-color: var(--accent); }
.deliverable-ext {
  min-width: 44px; padding: 5px 6px; border-radius: 6px; text-align: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.deliverable-name { font-weight: 600; overflow-wrap: anywhere; }
.deliverable-size { color: var(--muted); font-size: 13px; white-space: nowrap; }
.deliverable-get { color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: underline; }
@media (max-width: 560px) {
  .deliverable { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 2px; }
  .deliverable-ext { grid-row: 1 / span 2; }
  .deliverable-size { grid-column: 2; grid-row: 2; }
  .deliverable-get { grid-column: 3; grid-row: 1 / span 2; }
}

/* --- Bids --- */
.bid-block { padding: 14px 0; border-bottom: 1px solid var(--line); }
.bid-block:last-child { border-bottom: 0; padding-bottom: 0; }
.bid-block:first-of-type { padding-top: 4px; }
.bid-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.bid-fields { display: flex; gap: 12px; flex-wrap: wrap; }
.bid-fields > div { flex: 1 1 140px; }
/* A number and its unit on one line: "6 [hours]". */
.delivery-time { display: flex; gap: 8px; }
.delivery-time input { flex: 1 1 60px; min-width: 0; }
.delivery-time select { flex: 0 0 auto; width: auto; }
.under { font-size: 12px; color: var(--paid); margin-left: 5px; }
.mine { color: var(--paid); font-weight: 600; }

.review-note {
  margin-top: 10px; padding: 10px 12px; border-radius: 8px;
  font-size: 14px; border-left: 3px solid var(--line); background: var(--bg);
}
.review-ok { border-left-color: var(--paid); background: #f0fdf4; }
.review-back { border-left-color: var(--stop); background: #fff5f6; }

/* --- Review checklist --- */
.check-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; padding-bottom: 0; }
.check-label { margin-bottom: 8px; }
.check-guidance { font-size: 13px; margin-top: 2px; }
.check-options { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.check-opt { display: inline-flex; align-items: center; gap: 5px; font-weight: 400; margin: 0; }
.check-opt input { width: auto; margin: 0; }
.check-row input[type=text] { margin-bottom: 0; font-size: 13px; padding: 7px 10px; }
.check-fail {
  margin-top: 8px; padding: 8px 10px; border-radius: 6px;
  background: #fff; border-left: 3px solid var(--stop); font-size: 14px;
}
.check-details { margin-top: 10px; font-size: 13px; }
.check-details summary { cursor: pointer; color: var(--muted); }
.check-line { padding: 5px 0 5px 2px; }
.check-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 99px;
  margin-right: 6px; vertical-align: middle;
}

/* --- Ledger --- */
.ledger-row {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.ledger-row:last-child { border-bottom: 0; padding-bottom: 0; }
.ledger-right { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.ledger-right .money { font-weight: 600; font-size: 15px; }
.negative { color: var(--stop); font-weight: 600; }
.split-table { width: 100%; font-size: 14px; border-collapse: collapse; }
.split-table td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.split-table td:last-child { text-align: right; font-weight: 600; }
.split-table tr:last-child td { border-bottom: 0; border-top: 2px solid var(--line); }

/* --- Profiles --- */
.me { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); text-decoration: none; }
.me:hover { color: var(--accent); }
.avatar-xs { width: 24px; height: 24px; border-radius: 99px; object-fit: cover; }
.avatar-sm { width: 64px; height: 64px; border-radius: 99px; object-fit: cover; }
.avatar-lg {
  width: 92px; height: 92px; border-radius: 99px; object-fit: cover;
  border: 1px solid var(--line); flex-shrink: 0;
}
.avatar-blank {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 34px; font-weight: 700;
}
.profile-head {
  display: flex; gap: 20px; align-items: flex-start;
  flex-wrap: wrap; margin-bottom: 24px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-size: 13px; padding: 4px 11px; border-radius: 99px;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink-2);
}
.skill-grid {
  display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.skill-opt { display: flex; align-items: center; gap: 7px; font-weight: 400; margin: 0; font-size: 14px; }
.skill-opt input { width: auto; margin: 0; }
.cert-row {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.cert-row:last-of-type { border-bottom: 0; }
.currency-note {
  font-size: 13px; color: var(--muted); padding: 8px 12px;
  background: var(--panel); border-radius: 8px; margin-bottom: 14px;
}

.pay-instructions {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; font-size: 14px;
}
.pay-claimed {
  background: #fffbeb; border-left: 3px solid var(--held); border-radius: 6px;
  padding: 10px 12px; font-size: 14px;
}
.pay-details summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent); }

.verdict {
  padding: 10px 12px; border-radius: 8px; background: var(--panel);
  font-size: 14px; margin: 0 0 12px;
}
.verdict-warn { background: #fef3c7; border-left: 3px solid var(--held); }

.proof-link {
  display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600;
  padding: 5px 11px; border-radius: 7px; background: var(--accent-soft);
  border: 1px solid var(--accent); text-decoration: none;
}
.proof-missing { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--held); }

/* --- Ratings --- */
.stars { color: var(--held); letter-spacing: 1px; font-size: 15px; }
.star-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--line);
}
.star-label { font-size: 14px; font-weight: 600; }
.star-pick { display: inline-flex; gap: 4px; align-items: center; }
.star-pick input { width: auto; margin: 0 2px 0 8px; }
.star-pick label { display: inline; font-weight: 400; margin: 0; font-size: 14px; }
.rep-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.rep-figure { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.rep-label { font-size: 12px; color: var(--muted); }

.badge-active {
  background: var(--paid);
}
.badge-active::before { content: "● "; font-size: 9px; vertical-align: 1px; }

.private-card { border-left: 3px solid var(--accent); }
.private-tag {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--accent); background: var(--accent-soft);
  padding: 2px 7px; border-radius: 99px; margin-left: 6px;
  vertical-align: 2px;
}

.writer-card { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }

/* --- Conversations --- */
.msg-row { display: flex; margin-bottom: 10px; }
.msg-mine { justify-content: flex-end; }
.msg-bubble {
  max-width: 78%; padding: 10px 13px; border-radius: 12px;
  background: var(--panel); font-size: 14px;
}
.msg-mine .msg-bubble { background: var(--accent-soft); }
.msg-who { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.msg-who .dim { font-weight: 400; margin-left: 6px; }
.msg-bubble .prose p { margin: 0; }

/* --- Notifications --- */
.bell {
  position: relative; display: inline-flex; align-items: center;
  text-decoration: none; color: var(--muted);
}
.bell:hover { color: var(--accent); }
/* Red because unread means needs-you, which is what red is kept for. */
.bell.bell-on, .bell.bell-on:hover { color: var(--stop); }
.bell-count {
  position: absolute; top: -6px; left: 11px; background: var(--stop); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1.4; padding: 0 5px; border-radius: 99px;
}
.bell-count[hidden] { display: none; }

/* A short wiggle when a new notification arrives while the page is open. Only
   then: ringing on every page load would be noise within a day. */
.bell .icon { transform-origin: 50% 3px; }
.bell.ringing .icon { animation: bell-ring 0.9s ease-in-out; }
@keyframes bell-ring {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-12deg); }
  45% { transform: rotate(9deg); }
  60% { transform: rotate(-6deg); }
  75% { transform: rotate(3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .bell.ringing .icon { animation: none; }
}
.note-row {
  display: flex; gap: 11px; align-items: flex-start; padding: 11px 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.note-row:last-child { border-bottom: 0; }
.note-new { background: var(--bg); margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
.note-dot { width: 8px; height: 8px; border-radius: 99px; margin-top: 6px; flex-shrink: 0; }
.note-text { flex: 1; font-size: 14px; }
.note-text .dim { display: block; margin-top: 2px; }
.note-when { font-size: 12px; white-space: nowrap; }

/* --- Avatar picker --- */
.avatar-field { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.avatar-current {
  width: 84px; height: 84px; border-radius: 99px; object-fit: cover;
  border: 1px solid var(--line); flex-shrink: 0;
}
.avatar-actions { flex: 1; min-width: 200px; }
.avatar-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.avatar-pick { display: inline-block; cursor: pointer; font-size: 14px; padding: 8px 16px; }
.avatar-clear { margin-top: 10px; font-size: 13px; }
.avatar-hint { font-size: 12px; margin: 8px 0 0; }

.crop-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 16px;
}
.crop-backdrop[hidden] { display: none; }
.crop-panel {
  background: #fff; border-radius: 14px; padding: 22px;
  max-width: 380px; width: 100%;
}
.crop-stage {
  position: relative; width: 320px; height: 320px; max-width: 100%;
  margin: 0 auto; cursor: grab; overflow: hidden; border-radius: 10px;
  touch-action: none; user-select: none;
}
.crop-stage:active { cursor: grabbing; }
.crop-stage canvas { display: block; width: 100%; height: 100%; }
.crop-ring {
  position: absolute; inset: 0; pointer-events: none; border-radius: 10px;
  box-shadow: 0 0 0 999px rgba(15,23,42,0.55) inset;
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 49%, #000 50%);
  mask: radial-gradient(circle at 50% 50%, transparent 49%, #000 50%);
}
.crop-zoom { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; }
.crop-zoom input { flex: 1; margin: 0; padding: 0; }

.danger-zone { border-color: var(--stop); background: var(--card); }

.filter-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.pill {
  font-size: 13px; padding: 5px 12px; border-radius: 99px; text-decoration: none;
  background: #fff; border: 1px solid var(--line); color: var(--muted);
}
.pill-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-form {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px;
}
.filter-form input, .filter-form select { margin-bottom: 0; width: auto; flex: 1 1 160px; }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; margin-bottom: 14px; font-size: 14px;
  font-family: inherit; background: #fff;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent;
}
.btn {
  display: inline-block; padding: 10px 20px; border: 0; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; font-family: inherit;
}
.btn:hover { filter: brightness(0.93); }
.btn-block { width: 100%; }
.btn-quiet {
  background: transparent; color: var(--muted); padding: 0; border: 0;
  font-weight: 400; font-size: 14px; cursor: pointer; text-decoration: none;
  font-family: inherit;
}

.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.alert-error { background: #ffe4e6; color: var(--stop); }
.alert-success { background: #dcfce7; color: var(--paid); }
/* Neutral on purpose. Telling somebody what will happen when they save is
 * not a state, so it does not get a state colour. */
.alert-info { background: var(--panel); color: var(--ink-2); border: 1px solid var(--line); }
.helptext, .errorlist { font-size: 12px; }
.helptext { color: var(--muted); margin: -10px 0 14px; display: block; }
.errorlist { color: var(--stop); list-style: none; padding: 0; margin: -8px 0 12px; }
ul.radio { list-style: none; padding: 0; margin: 0 0 14px; }
ul.radio li { margin-bottom: 6px; }
ul.radio input { width: auto; margin-right: 7px; }
ul.radio label { display: inline; font-weight: 400; }
.muted-links { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 0; }

/* ============================================================================
 * Redesign layer
 *
 * Everything above is the original component set, still used across the site.
 * What follows is the structure the redesign adds: a progress track, a single
 * primary action per page, a two-column layout, and money that looks different
 * depending on whether it has actually been paid.
 * ========================================================================= */

/* --- Two columns -----------------------------------------------------------
 * Content left, status and actions right. The sidebar holds what you glance at;
 * the main column holds what you read. One wide column meant scrolling past the
 * brief to reach the buttons.
 */
.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
}
.side .card { padding: 16px; }
.side h2 { font-size: 14px; }

/* --- Progress track --------------------------------------------------------
 * A task moves through ten states and used to show one badge. This answers
 * "where is my order" without anyone having to ask.
 */
.track { display: flex; align-items: flex-start; margin: 2px 0 4px; }
.track-step {
  flex: 1; text-align: center; position: relative;
  font-size: 12px; color: var(--muted);
}
.track-step:not(:last-child)::after {
  content: ""; position: absolute; top: 11px;
  left: calc(50% + 14px); right: calc(-50% + 14px);
  height: 2px; background: var(--line);
}
.track-step.is-done:not(:last-child)::after { background: var(--paid); }
.track-dot {
  width: 24px; height: 24px; border-radius: 99px; margin: 0 auto 7px;
  background: #fff; border: 2px solid var(--line);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--muted);
  position: relative; z-index: 1;
}
.is-done .track-dot { background: var(--paid); border-color: var(--paid); color: #fff; }
.is-now .track-dot {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}
.track-step.is-done, .track-step.is-now { color: var(--ink); }
.track-step.is-now { font-weight: 700; }
.track-step.is-stopped .track-dot { background: var(--stop); border-color: var(--stop); color: #fff; }

/* --- The one thing to do now -----------------------------------------------
 * Every block used to be a card of equal weight, so a task page shouted eight
 * things at once. This one outranks the rest.
 */
.action {
  background: linear-gradient(180deg, #fff, var(--bg));
  border: 1px solid var(--accent);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 16px;
}
.action h2 { font-size: 19px; margin: 0 0 6px; letter-spacing: -0.02em; }
.action p { margin: 0 0 16px; color: var(--muted); font-size: 14px; max-width: 62ch; }
.action.is-waiting { border-color: var(--held); border-left-color: var(--held); }
.action.is-done { border-color: var(--paid); border-left-color: var(--paid); }
.action.is-blocked { border-color: var(--stop); border-left-color: var(--stop); }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* --- Waiting on you --------------------------------------------------------
 * A dashboard should be a to-do list. Counters are wallpaper.
 */
.todo {
  background: #fff; border: 1px solid var(--accent);
  border-radius: 12px; overflow: hidden; margin-bottom: 22px;
}
.todo-head {
  background: var(--accent-soft); border-bottom: 1px solid var(--accent-soft);
  padding: 12px 18px; font-weight: 700; font-size: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.todo-count {
  background: var(--accent); color: #fff;
  border-radius: 99px; font-size: 12px; padding: 2px 9px;
}
.todo-item {
  display: flex; gap: 13px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.todo-item:last-child { border-bottom: 0; }
.todo-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 14px; color: #fff;
  background: var(--accent);
}
.todo-icon.pay { background: var(--stop); }
.todo-icon.ready { background: var(--paid); }
.todo-icon.review { background: var(--held); }
.todo-body { flex: 1; min-width: 0; }
.todo-title { font-weight: 600; font-size: 14px; }
.todo-sub { font-size: 13px; color: var(--muted); }
/* A line of what was actually said, so the item can be weighed from here.
 * One line, clipped, because the list is for deciding what to open. */
.todo-quote {
  display: block; margin-top: 3px; font-size: 13px; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.todo-quote-by {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; margin-right: 4px;
}
.todo-age { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* --- Things moving without you --------------------------------------------- */
.quiet-list h2 { font-size: 14px; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.quiet-row {
  display: flex; gap: 14px; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px;
}
.quiet-stage { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.blip { width: 7px; height: 7px; border-radius: 99px; background: var(--held); flex-shrink: 0; }
.blip.ok { background: var(--paid); }
.blip.info { background: var(--accent); }

/* --- Money with a state ----------------------------------------------------
 * Held and paid used to look identical. Held money is the thing writers most
 * want to understand.
 */
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.total {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; position: relative; overflow: hidden;
}
.total::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.total.held::before { background: var(--held); }
.total.paid::before { background: var(--paid); }
.total.due::before  { background: var(--accent); }
.total .figure {
  font-size: 25px; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.total.held .figure { color: var(--held); }
.total.paid .figure { color: var(--paid); }
.total .label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.total .note { font-size: 12px; color: var(--muted); margin-top: 9px; line-height: 1.45; }

.state {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 3px 9px; border-radius: 99px;
  white-space: nowrap; display: inline-block;
}
.state-held { background: #fef3c7; color: #78350f; }
.state-paid { background: #dcfce7; color: var(--paid); }
.state-reversed { background: #ffe4e6; color: var(--stop); text-decoration: line-through; }
.state-pending { background: var(--accent-soft); color: var(--accent); }
.row-faded { opacity: 0.55; }

/* --- Key/value blocks for the sidebar -------------------------------------- */
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* --- Bid rows --------------------------------------------------------------
 * What a client needs to choose: who, how good, how much, how soon.
 */
.bid-line { display: flex; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.bid-line:last-child { border-bottom: 0; }
.bid-who { flex: 1; min-width: 0; }
.bid-name { font-weight: 600; font-size: 14px; }
.bid-sub { font-size: 12px; color: var(--muted); }
.bid-amount { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px; text-align: right; }
.avatar-md {
  width: 38px; height: 38px; border-radius: 99px; flex-shrink: 0; object-fit: cover;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--accent); color: #fff;
}

/* --- Empty states ----------------------------------------------------------
 * A first-run user sees more of these than full pages, so they should teach
 * rather than just say "nothing yet".
 */
.blank { text-align: center; padding: 34px 20px; }
.blank-mark { font-size: 28px; line-height: 1; margin-bottom: 10px; opacity: 0.35; }
.blank h3 { margin: 0 0 6px; font-size: 16px; }
.blank p { margin: 0 auto 16px; color: var(--muted); font-size: 14px; max-width: 46ch; }


/* Buttons used as full-width blocks in the sidebar need to behave like blocks.
   btn-quiet was written for inline use next to other controls. */
.side .btn-quiet,
.side .btn {
  display: block; text-align: center; width: 100%;
  padding: 9px 14px; text-decoration: none;
}
.side form { margin: 0; }
.side input[type="number"], .side input[type="text"] { margin-bottom: 8px; }


/* --- Bid spread, on the writer's side --------------------------------------
 * Amounts only. The names are deliberately absent, so this can't be laid out
 * as a list that later grows a "who" column by accident.
 */
.bid-spread {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.spread-end { display: flex; flex-direction: column; }
.spread-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--muted);
}
.spread-value {
  font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.spread-bar {
  flex: 1; height: 2px; border-radius: 99px;
  background: linear-gradient(90deg, var(--paid), var(--held));
}



/* ============================================================================
 * Paper shell: sidebar navigation
 *
 * The top bar worked at six links. An administrator has eleven, and it wrapped
 * to two lines on a laptop. Vertical holds any number, and leaves room for a
 * count beside each queue — which is the thing somebody running the site
 * actually wants to see without clicking.
 * ========================================================================= */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 216px; flex-shrink: 0; background: var(--panel);
  border-right: 1px solid var(--line); padding: 18px 12px;
  display: flex; flex-direction: column;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 9px;
  padding: 0 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.nav-group {
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted);
  padding: 0 8px; margin: 14px 0 6px;
}
.nav-group:first-of-type { margin-top: 0; }
.sidebar nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 7px;
  color: var(--ink-2); font-size: 14px; margin-bottom: 1px; text-decoration: none;
}
.sidebar nav a:hover { background: var(--card); }
.sidebar nav a.on {
  background: var(--card); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(41, 37, 36, 0.06);
}
.sidebar .icon { flex-shrink: 0; color: var(--muted); }
.sidebar nav a:hover .icon { color: var(--ink-2); }
.sidebar nav a.on .icon { color: var(--accent); }
/* Red, like the bell: every count here is something waiting on you. */
.nav-count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--stop); color: #fff; border-radius: 99px; padding: 1px 7px;
}
.nav-count[hidden] { display: none; }
.nav-count.quiet { background: var(--line); color: var(--ink-2); }
/* Small and quiet, in the top bar beside the breadcrumb: it stays in the same
   place whether the sidebar is open or collapsed, and leaves the sidebar to
   navigation. */
.toggle-form { margin: 0; display: flex; }
.sidebar-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin-left: -6px;
  padding: 0; border: 0; border-radius: 7px;
  background: none; color: var(--muted); cursor: pointer;
}
.sidebar-toggle:hover { background: var(--panel); color: var(--accent); }
.sidebar-foot {
  margin-top: auto; padding: 12px 8px 0;
  border-top: 1px solid var(--line); font-size: 12px; color: var(--muted);
}

/* Collapsed to a strip of icons. Counts stay, as small badges on the icon,
   because they're the reason the sidebar exists. The labels are clipped rather
   than removed so a screen reader still hears "Payments". Desktop only: on a
   phone the sidebar is already a strip across the top. */
@media (min-width: 861px) {
  .sidebar { transition: width 0.15s ease, padding 0.15s ease; }
  .sidebar-collapsed .sidebar { width: 62px; padding: 18px 9px; }
  .sidebar-collapsed .sidebar .brand {
    width: 44px; overflow: hidden; padding: 0 9px 18px;
  }
  .sidebar-collapsed .sidebar .brand img { flex-shrink: 0; }
  .sidebar-collapsed .nav-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .sidebar-collapsed .nav-group {
    font-size: 0; height: 1px; background: var(--line); margin: 10px 8px; padding: 0;
  }
  .sidebar-collapsed .nav-group:first-of-type { display: none; }
  .sidebar-collapsed .sidebar nav a { justify-content: center; padding: 8px 0; position: relative; }
  .sidebar-collapsed .nav-count {
    position: absolute; top: 1px; right: 2px;
    font-size: 9px; line-height: 1.45; padding: 0 4px;
  }
  .sidebar-collapsed .sidebar-foot { display: none; }
}
/* Points the way it will move: « to collapse, » to expand. */
.sidebar-collapsed .sidebar-toggle .icon { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content-top {
  height: 58px; border-bottom: 1px solid var(--line); background: var(--card);
  display: flex; align-items: center; padding: 0 26px; gap: 14px;
}
.content-top .crumb { font-size: 13px; color: var(--muted); }
.content-top .right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; }

/* On a phone the sidebar becomes a strip of icons across the top. Collapsing
   it to a burger hides the counts, which are the reason it exists. */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex-direction: row; overflow-x: auto;
    border-right: 0; border-bottom: 1px solid var(--line);
    padding: 10px 12px; gap: 4px; align-items: center;
  }
  .sidebar .brand { border: 0; margin: 0 8px 0 0; padding: 0; }
  .sidebar nav { display: flex; gap: 4px; }
  /* The strip is already compact, so there's nothing to collapse. */
  .nav-group, .sidebar-foot, .toggle-form { display: none; }
  .sidebar nav a { white-space: nowrap; margin: 0; }
}

/* Tables, for the queues and the directory — the pages where you compare. */
.table { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.table th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted); padding: 11px 15px;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.table td { padding: 13px 15px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fdfbf7; }
.table .r, .table th.r { text-align: right; }
.table .num { font-variant-numeric: tabular-nums; font-weight: 600; }


/* --- Columns by stage ------------------------------------------------------
 * Four columns rather than a list, so a pile-up in one is visible without
 * counting. Own work carries a bronze edge, which is how "mine" and "could be
 * mine" sit in the same view without being confused.
 */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stage {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 11px; padding: 11px; min-width: 0;
}
.stage-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 3px 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px;
}
.stage-name { font-size: 13px; font-weight: 700; }
.stage-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px; margin-bottom: 8px; display: block;
  color: inherit; text-decoration: none;
}
.stage-card:last-child { margin-bottom: 0; }
.stage-card:hover { border-color: var(--accent); }
.stage-card.mine { border-left: 3px solid var(--accent); }
.stage-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; margin-bottom: 6px; }
.stage-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--muted); gap: 8px;
}
.stage-amount { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.stage-empty {
  font-size: 12px; color: var(--muted); text-align: center;
  padding: 16px 6px; border: 1px dashed var(--line); border-radius: 8px;
}
@media (max-width: 1000px) {
  .stages { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .stages { grid-template-columns: 1fr; }
}

/* Four figures across the top of a dashboard. */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.figure-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 11px;
  padding: 15px 16px; position: relative; overflow: hidden;
}
.figure-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line); }
.figure-card.held::before { background: var(--held); }
.figure-card.paid::before { background: var(--paid); }
.figure-card .figure {
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 23px; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.figure-card.held .figure { color: var(--held); }
.figure-card.paid .figure { color: var(--paid); }
.figure-card .figure-label { font-size: 12px; color: var(--muted); margin-top: 1px; }


/* --- Pagination ------------------------------------------------------------
 * The filters travel with the page number. Without that, page 2 quietly drops
 * what you searched for and shows you a different set of people.
 */
.pager {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; font-size: 13px; color: var(--muted);
}
.pager .pages { display: flex; gap: 7px; align-items: center; }
.pager a, .pager span.here {
  padding: 6px 12px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); text-decoration: none;
}
.pager span.here { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }
.pager .off { opacity: 0.4; pointer-events: none; }


/* The brief stays beside the checklist rather than scrolling away above it. */
.review-side .card { position: sticky; top: 18px; }
.review-side .card + .card { position: static; }
@media (max-width: 900px) { .review-side .card { position: static; } }


/* --- Conversation ----------------------------------------------------------
 * The brief stays beside the thread. Negotiating is a comparison between what
 * was asked for and what is being offered, and in one column the brief
 * scrolled away as soon as the conversation had any length.
 */
.conversation-side .card:first-child { position: sticky; top: 18px; }
@media (max-width: 900px) { .conversation-side .card { position: static; } }

/* Amber: something is waiting on you to look again, which is what amber means. */
.chat-stale {
  border-left: 3px solid var(--held); padding-left: 10px; margin-bottom: 12px;
}
.chat-stale[hidden] { display: none; }

/* Messages read as a conversation rather than a list of rows. */
.msg-row { display: flex; margin-bottom: 12px; }
.msg-row.msg-mine { justify-content: flex-end; }
.msg-bubble {
  max-width: 78%; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px 12px 12px 4px; padding: 11px 14px;
}
.msg-mine .msg-bubble {
  background: var(--accent-soft); border-color: #e3d2bd;
  border-radius: 12px 12px 4px 12px;
}
.msg-who { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.msg-who .dim { font-weight: 400; margin-left: 6px; }
.msg-bubble .prose { font-size: 14px; }
.msg-bubble .prose p:last-child { margin-bottom: 0; }


/* A destructive action reads differently from a brand one. Kept as a class
   rather than an inline state colour, so `--stop` keeps meaning "this stopped"
   wherever it appears as a badge. */
.btn-danger { background: var(--stop); }

/* --- File pickers ----------------------------------------------------------
 *
 * Built by static/js/uploads.js around any <input type=file data-upload>. The
 * input itself stays in the page, focusable but invisible: a required file
 * input that is display:none makes Chrome refuse to submit the form with a
 * validation message nobody can see, pointing at a control nobody can find.
 */
.picker { margin-bottom: 14px; }
/* Two classes, because input[type=file] above sets width: 100% and outranks
 * one. That stretched this invisible input to the width of the window and
 * gave every page with a picker a sideways scroll. */
.picker .picker-input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: 0;
  opacity: 0; overflow: hidden;
}
.picker-drop {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px; border: 1px dashed var(--line);
  border-radius: 8px; background: var(--panel);
}
.picker-input:focus-visible ~ .picker-drop,
.picker-over { border-color: var(--accent); border-style: solid; background: var(--accent-soft); }
.picker-hint { font-size: 13px; color: var(--muted); }
.btn-outline {
  display: inline-block; padding: 8px 16px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink);
  font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.picker-list { list-style: none; margin: 10px 0 0; padding: 0; }
.picker-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--card); margin-bottom: 6px; font-size: 14px;
}
.picker-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.picker-size { color: var(--muted); font-size: 13px; white-space: nowrap; }
/* Quiet, not red. Red on this site means a task has stopped or needs you, and
 * taking a file back out of a list you have not submitted yet is neither. */
.picker-remove {
  border: 0; background: transparent; color: var(--muted);
  font-family: inherit; font-size: 13px; cursor: pointer;
  text-decoration: underline; padding: 2px 4px;
}
.picker-remove:hover { color: var(--ink); }
.picker-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.picker-line { display: block; }
/* An unreadable file is something the person has to act on, so it earns the
 * colour that means exactly that. */
.picker-bad { color: var(--stop); }
/* Files sent straight to storage show where each one has got to. The bar is
 * bronze because it marks progress, not a state. "Uploaded" stays plain ink:
 * green here would say "paid". */
.picker-direct { position: relative; overflow: hidden; flex-wrap: wrap; }
.picker-state { color: var(--muted); font-size: 13px; white-space: nowrap; }
.picker-failed .picker-state { color: var(--stop); white-space: normal; }
.picker-bar {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 0;
  background: var(--accent); transition: width .2s ease;
}

/* A card heading with one quiet action beside it. */
.card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.card-head h2 { margin-top: 0; }

/* A heading for a group of controls, where a <label for> has nothing to point
 * at. Matches a label so the form still reads as one column. */
.field-label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px;
}
.checkbox-list label {
  display: flex; align-items: center; gap: 8px;
  font-weight: 400; margin-bottom: 6px;
}
.checkbox-list input { margin: 0; }
