/* Gigxie app pages (signed-in surfaces). Section per page — append below, don't rewrite. */

/* ============================================================
   Inbox — inbox.html
   ============================================================ */
.inbox-page { padding: 32px 0 56px; }
.inbox-head { margin-bottom: 20px; }
.inbox-head h1 { font-size: 32px; letter-spacing: -0.02em; margin-bottom: 4px; }
.inbox-head p { font-size: 15px; color: var(--muted); }

.inbox-shell {
  display: grid;
  /* The rail's track is opt-in (see the min-width:1100 rule below) — reserving it
     while the rail is hidden left a dead 304px column on the signed-out page. */
  grid-template-columns: 336px minmax(0, 1fr);
  height: clamp(520px, calc(100vh - 288px), 760px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.inbox-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.inbox-list { border-right: 1px solid var(--line); background: var(--bg); }
.inbox-convo { background: var(--bg-soft); }
/* Every pane child sets its own display, which would otherwise beat [hidden]. */
.inbox-shell [hidden] { display: none; }

.inbox-pane-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
/* min-width:0 + ellipsis: the head is a flex row, and an unshrinkable h2 next to
   the unread count squeezed the Refresh button's icon to width:0. */
.inbox-pane-head h2 {
  font-size: 20px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-pane-head .inbox-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  /* Uppercase + tracking at the 336px pane width wrapped "3 · 2 unread" onto a
     second line and broke the baseline next to the h2. */
  white-space: nowrap;
}
.inbox-refresh {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--r-btn);
  transition: color var(--ease), background var(--ease);
}
.inbox-refresh:hover { color: var(--brand); background: var(--brand-tint); }
.inbox-refresh:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* flex:none, or the icon is the only shrinkable item in a tight head and silently
   collapses to 0px the moment the unread count has text. */
.inbox-refresh svg { width: 15px; height: 15px; flex: none; }
.inbox-refresh.is-busy svg { animation: inbox-spin 900ms linear infinite; }
@keyframes inbox-spin { to { transform: rotate(360deg); } }

/* ---- Thread search + filter ---- */
.inbox-filter {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.inbox-search { position: relative; display: flex; flex: 1; min-width: 0; }
.inbox-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}
.inbox-search input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 14px;
}
.inbox-search input::placeholder { color: var(--muted); }
.inbox-search input:hover { border-color: #CFCFE0; }
.inbox-search input:focus { outline: none; border-color: var(--brand); background: var(--bg); box-shadow: 0 0 0 3px var(--brand-tint); }
.inbox-search input::-webkit-search-cancel-button { cursor: pointer; }
.inbox-filter .chip { flex: none; height: 36px; padding: 0 14px; font-size: 13px; font-weight: 600; }
.thread-none {
  padding: 24px 20px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

/* ---- Thread list ---- */
.thread-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
}
.thread-item {
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  box-shadow: inset 3px 0 0 transparent;
  transition: background var(--ease), box-shadow var(--ease);
}
.thread-item:hover { background: var(--bg-soft); }
.thread-item:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.thread-item[aria-current="true"] {
  background: var(--brand-tint);
  box-shadow: inset 3px 0 0 var(--brand);
}
.thread-item .avatar { flex: none; width: 40px; height: 40px; font-size: 14px; }
.thread-body { flex: 1; min-width: 0; }
.thread-top { display: flex; align-items: baseline; gap: 8px; }
.thread-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-time { margin-left: auto; flex: none; font-size: 12px; color: var(--muted); }
.thread-gig {
  /* Must be block: overflow/text-overflow are no-ops on an inline box, so a long
     gig title ran straight through the row divider with no ellipsis. */
  display: block;
  font-size: 12px;
  color: var(--brand);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}
.thread-preview {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.thread-item.is-unread .thread-name { font-weight: 700; }
.thread-item.is-unread .thread-preview { color: var(--body); font-weight: 500; }
.thread-dot {
  flex: none;
  align-self: center;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
}

/* ---- Conversation header ---- */
.convo-head-meta { min-width: 0; }
.convo-head-meta h2 {
  font-size: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.convo-head-meta p {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.convo-head-meta a { color: var(--brand); font-weight: 600; }
.convo-head-meta a:hover { text-decoration: underline; }
.inbox-back {
  display: none;
  width: 36px;
  height: 36px;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink);
  transition: background var(--ease), color var(--ease);
}
.inbox-back:hover { background: var(--bg-soft); color: var(--brand); }
.inbox-back:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.inbox-back svg { width: 20px; height: 20px; }

/* ---- Messages ---- */
.msg-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.msg-day {
  align-self: center;
  margin: 16px 0 12px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.msg-row { display: flex; flex-direction: column; align-items: flex-start; margin-top: 8px; }
.msg-row.is-mine { align-items: flex-end; }
.msg-row + .msg-row.is-same { margin-top: 2px; }
.bubble {
  max-width: min(560px, 80%);
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.msg-row.is-mine .bubble {
  background: var(--brand-tint);
  border-color: var(--brand-wash);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 4px;
}
.msg-meta { margin: 4px 4px 0; font-size: 12px; color: var(--muted); }
.msg-row.is-pending { opacity: .55; }

/* ---- Composer ---- */
.composer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.composer textarea {
  flex: 1;
  min-height: 44px;
  max-height: 160px;
  /* 11px block padding is not arbitrary: it centres one 15px/1.4 line inside the
     44px control height the button shares, and keeps autoGrow's scrollHeight
     under min-height so a single line never grows the row. */
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
  resize: none;
  overflow-y: auto;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.composer textarea:hover { border-color: #CFCFE0; }
.composer textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.composer textarea::placeholder { color: var(--muted); }
.composer .btn { flex: none; }
.composer .btn svg { width: 17px; height: 17px; }
.composer-hint {
  flex: none;
  padding: 0 16px 12px;
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
}
/* --danger-ink, not --danger: this is 12px text, and --danger is 3.9:1. */
.composer-hint.is-error { color: var(--danger-ink); font-weight: 600; }
.composer-hint kbd {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--body);
}

/* ---- Loading / empty / error states ---- */
.pane-state {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 24px;
  text-align: center;
}
.pane-state[hidden] { display: none; }
.pane-state svg { width: 44px; height: 44px; color: var(--brand); opacity: .55; }
/* 16px, not 19px: the h2 that governs this pane is 20px, so an h3 above it
   inverted the heading hierarchy. */
.pane-state h3 { font-size: 16px; }
.pane-state p { font-size: 14px; color: var(--muted); max-width: 40ch; line-height: 1.55; }
.pane-state .btn { margin-top: 8px; }
.pane-state.is-error svg { color: var(--danger); opacity: .7; }

.sk-list { padding: 16px 20px; display: grid; gap: 24px; }
.sk-row { display: flex; gap: 12px; align-items: flex-start; }
.sk {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-soft) 25%, #EEEEF5 37%, var(--bg-soft) 63%);
  background-size: 400% 100%;
  animation: sk-shimmer 1.4s ease infinite;
}
.sk-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.sk-lines { flex: 1; display: grid; gap: 8px; }
.sk-lines .sk { height: 10px; }
.sk-lines .sk:nth-child(1) { width: 48%; }
.sk-lines .sk:nth-child(2) { width: 88%; }
.sk-lines .sk:nth-child(3) { width: 66%; }
@keyframes sk-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; }
  .inbox-refresh.is-busy svg { animation: none; }
}

/* ---- Right rail: who you're talking to + the work in flight ---- */
.inbox-rail {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  overflow-y: auto;
  padding: 20px;
  border-left: 1px solid var(--line);
  background: var(--bg);
}
.rail-block > h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.rail-who { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.rail-who .avatar { flex: none; width: 44px; height: 44px; font-size: 15px; }
.rail-who-text { min-width: 0; }
.rail-who-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-who-role { display: block; font-size: 13px; color: var(--muted); }
.rail-facts { display: grid; gap: 8px; margin: 0 0 16px; }
.rail-fact { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.rail-fact dt { color: var(--muted); flex: none; }
.rail-fact dd { color: var(--ink); font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.inbox-rail .btn { width: 100%; }
.rail-orders { display: grid; gap: 8px; }
.rail-order {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  background: var(--bg-soft);
  color: inherit;
  transition: border-color var(--ease), background var(--ease), box-shadow var(--ease), transform var(--ease);
}
.rail-order:hover {
  border-color: var(--brand);
  background: var(--bg);
  color: inherit;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
@media (prefers-reduced-motion: reduce) {
  .rail-order:hover { transform: none; }
}
.rail-order:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.rail-order-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rail-order-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rail-order-price { font-size: 13px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.rail-empty { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ---- Responsive: the rail, then one pane at a time ---- */
@media (min-width: 1100px) {
  /* data-rail is "on" only while a conversation is open, so the signed-out and
     idle states don't leave an empty 304px column against the card edge. */
  .inbox-shell[data-rail="on"] { grid-template-columns: 336px minmax(0, 1fr) 304px; }
}
@media (max-width: 1099px) {
  .inbox-rail { display: none; }
}
@media (max-width: 860px) {
  .inbox-page { padding: 20px 0 40px; }
  .inbox-head h1 { font-size: 26px; }
  .inbox-shell {
    grid-template-columns: minmax(0, 1fr);
    /* 100vh counts the collapsing mobile URL bar, so the composer starts below
       the fold on first paint. dvh is the real viewport; vh stays as fallback. */
    height: calc(100vh - 190px);
    height: calc(100dvh - 190px);
    min-height: 460px;
  }
  .inbox-list { border-right: 0; }
  .inbox-back { display: inline-flex; }
  .inbox-shell[data-view="list"] .inbox-convo,
  .inbox-shell[data-view="convo"] .inbox-list { display: none; }
  .bubble { max-width: 86%; }
  .msg-scroll { padding: 16px; }
}
@media (min-width: 861px) {
  /* Desktop always shows both panes, whatever the mobile state was. */
  .inbox-shell[data-view] .inbox-list,
  .inbox-shell[data-view] .inbox-convo { display: flex; }
}
@media (max-width: 420px) {
  .inbox-pane-head, .inbox-filter, .thread-item, .sk-list { padding-inline: 16px; }
  .composer { padding: 12px; }
  .composer .btn { padding-inline: 16px; }
  /* #send carries aria-label="Send message", so dropping the visible label here
     does not leave the primary action without an accessible name. */
  .composer .btn-label { display: none; }
}

/* ============================================================
   Order detail — order.html
   ============================================================ */
.order-page { padding: 24px 0 72px; }
.order-page .breadcrumbs { margin-bottom: 20px; }

/* ---- Page-level states ---- */
/* Capped: at full container width 72px of block padding around one sentence of
   46ch produced a ~470px-tall empty card. */
.order-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  max-width: 620px;
  margin-inline: auto;
  padding: 48px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
  box-shadow: var(--shadow-card);
}
.order-state[hidden] { display: none; }
.order-state svg { width: 44px; height: 44px; color: var(--brand); opacity: .55; }
.order-state h1 { font-size: 24px; font-family: var(--font-head); }
.order-state p { font-size: 16px; color: var(--muted); max-width: 46ch; line-height: 1.55; }
.order-state-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.order-state.is-error svg { color: var(--danger); opacity: .75; }

.order-skeleton[hidden] { display: none; }
.order-skeleton .sk { display: block; }
.order-sk-card {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
  padding: 24px;
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}
.order-sk-card .sk { height: 12px; }
.order-sk-card .sk:nth-child(1) { height: 26px; width: 46%; }
.order-sk-card .sk:nth-child(2) { width: 88%; }
.order-sk-card .sk:nth-child(3) { width: 64%; }
.order-sk-card .sk:nth-child(4) { width: 76%; }

/* ---- Header ---- */
.order-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.order-thumb {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: var(--r-card);
  display: grid;
  place-items: center;
  color: #fff;
}
.order-thumb svg { width: 30px; height: 30px; }
.order-head-text { flex: 1; min-width: 220px; }
.order-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.order-head h1 { font-size: 32px; letter-spacing: -0.02em; line-height: 1.25; }
.order-head-sub { font-size: 14px; color: var(--muted); margin-top: 6px; }
.order-head-sub strong { color: var(--body); font-weight: 600; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--brand-tint);
  color: var(--brand-dark);
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill[data-status="in_progress"] { background: #FFF4E0; color: #8A5200; }
.status-pill[data-status="delivered"] { background: var(--brand-tint); color: var(--brand-dark); }
.status-pill[data-status="completed"] { background: #E6F7EF; color: var(--success-ink); }
.status-pill[data-status="cancelled"] { background: var(--danger-wash); color: #B4262A; }

/* ---- Layout ---- */
.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  gap: 24px;
  align-items: start;
}
.order-main { display: grid; gap: 24px; min-width: 0; }
/* A sticky box taller than the viewport stops moving and hides its own tail — on
   a completed order that tail is the receipt total. Cap it and let it scroll. */
.order-side {
  display: grid;
  gap: 24px;
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
}

.order-card {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.order-card[hidden] { display: none; }
.order-card > h2 {
  font-size: 20px;
  margin-bottom: 4px;
}
.order-card > .order-card-hint { font-size: 13px; color: var(--muted); margin-bottom: 20px; }

/* ---- Stepper ---- */
/* Auto columns, not repeat(4): a cancelled order renders 2 nodes, not 4. */
.stepper { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.step { position: relative; text-align: center; padding: 0 6px; }
.step::before {
  content: "";
  position: absolute;
  top: 15px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--line);
  transition: background var(--ease);
}
.step:first-child::before { display: none; }
.step.is-done::before, .step.is-current::before { background: var(--brand); }
.step-dot {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 2px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
}
.step-dot svg { width: 15px; height: 15px; }
.step.is-done .step-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.is-current .step-dot {
  background: var(--bg);
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-tint);
}
.step-label { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.35; }
.step.is-done .step-label, .step.is-current .step-label { color: var(--ink); }
.step-when { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.stepper.is-cancelled .step.is-done::before,
.stepper.is-cancelled .step.is-current::before { background: var(--danger); }
.stepper.is-cancelled .step.is-done .step-dot,
.stepper.is-cancelled .step.is-current .step-dot {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  box-shadow: none;
}

/* ---- Meta table ---- */
.order-meta { width: 100%; border-collapse: collapse; font-size: 14px; }
.order-meta caption { text-align: left; font-size: 13px; color: var(--muted); padding-bottom: 12px; }
.order-meta th, .order-meta td { text-align: left; padding: 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.order-meta tr:last-child th, .order-meta tr:last-child td { border-bottom: 0; }
.order-meta th { font-weight: 500; color: var(--muted); width: 42%; }
.order-meta td { color: var(--ink); font-weight: 600; }
.order-meta td a { color: var(--brand); }
.order-meta td a:hover { text-decoration: underline; }
.order-meta .mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.tier-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--body);
}

/* ---- Requirements ---- */
.order-reqs {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  padding: 16px 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.order-reqs.is-empty { color: var(--muted); font-style: italic; white-space: normal; }

/* ---- Action panel ---- */
.order-actions { display: grid; gap: 10px; }
/* Grid tracks size to min-content:auto, and .btn is nowrap + 24px inline padding,
   so a long label ("Accept delivery & release payment") sets an intrinsic floor
   wider than a 375px viewport. Let these wrap and grow instead. */
.order-actions .btn { width: 100%; white-space: normal; height: auto; min-height: 44px; padding-block: 10px; }
/* act() freezes the whole panel while a request is in flight — anchors included,
   or the user can navigate away mid-cancel. */
.order-actions [aria-disabled="true"] { pointer-events: none; opacity: .5; }
.action-note { font-size: 13px; color: var(--muted); line-height: 1.5; }
.action-note strong { color: var(--body); font-weight: 600; }
.inline-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
  color: #B4262A;
  background: var(--danger-wash);
  border-radius: var(--r-input);
  padding: 10px 12px;
}
.inline-error[hidden] { display: none; }
.inline-error svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
/* A 409 means the other party moved the order; the recovery button wraps under
   the message rather than squeezing it. */
.inline-error { flex-wrap: wrap; }
.inline-error > span { flex: 1 1 auto; min-width: 0; }
.inline-error .btn { flex: none; width: auto; height: 34px; min-height: 0; padding: 0 14px; font-size: 13px; }

/* ---- Receipt ---- */
.receipt-rows { display: grid; gap: 2px; margin-top: 4px; }
.receipt-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px dashed var(--line);
}
.receipt-row:last-of-type { border-bottom: 0; }
.receipt-row dt { color: var(--body); }
.receipt-row dd { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.receipt-row .receipt-sub { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.receipt-row.is-zero dd { color: var(--success-ink); }
.receipt-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 2px solid var(--line);
  font-size: 15px;
}
.receipt-total dt { font-weight: 600; color: var(--ink); }
.receipt-total dd { font-family: var(--font-head); font-size: 24px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.receipt-flag {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--r-input);
  background: var(--accent-wash);
  border: 1px solid #E8F3C8;
  font-size: 13px;
  line-height: 1.5;
  color: var(--body);
}
.receipt-flag svg { width: 16px; height: 16px; color: var(--success-ink); flex: none; margin-top: 2px; }

/* ---- Review form ---- */
.star-picker { display: flex; gap: 2px; border: 0; padding: 0; margin: 0 0 6px; }
.star-picker legend { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 8px; padding: 0; }
.star-opt { position: relative; }
.star-opt input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.star-opt span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-btn);
  color: #D8D8E4;
  transition: color var(--ease), background var(--ease), transform var(--ease);
}
.star-opt svg { width: 27px; height: 27px; fill: currentColor; }
/* data-value is driven by JS — on change, and transiently on hover for the preview.
   nth-of-TYPE, not nth-child: the <legend> is the fieldset's first element child,
   so nth-child would shift every label by one and fill n-1 stars. */
.star-picker[data-value="1"] .star-opt:nth-of-type(-n+1) span,
.star-picker[data-value="2"] .star-opt:nth-of-type(-n+2) span,
.star-picker[data-value="3"] .star-opt:nth-of-type(-n+3) span,
.star-picker[data-value="4"] .star-opt:nth-of-type(-n+4) span,
.star-picker[data-value="5"] .star-opt:nth-of-type(-n+5) span { color: var(--star); }
.star-opt input:hover + span { transform: scale(1.08); background: var(--bg-soft); }
.star-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.star-value { font-size: 13px; color: var(--muted); margin-bottom: 14px; min-height: 20px; }
.star-value strong { color: var(--ink); font-weight: 600; }
.review-form .field textarea { min-height: 108px; }
.review-form .btn { margin-top: 4px; }
.review-posted {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 20px;
  border-radius: var(--r-input);
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.review-posted .star-row { margin-bottom: 4px; }
.review-posted p { font-size: 14px; line-height: 1.6; color: var(--body); overflow-wrap: anywhere; }
.review-posted .review-when { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .order-layout { grid-template-columns: minmax(0, 1fr); }
  .order-side { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 620px) {
  .order-page { padding: 16px 0 48px; }
  .order-head h1 { font-size: 24px; }
  .order-thumb { width: 56px; height: 56px; }
  .order-thumb svg { width: 24px; height: 24px; }
  .order-card { padding: 20px 16px; }
  .stepper { grid-auto-flow: row; grid-template-columns: 1fr; gap: 0; text-align: left; }
  .step { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; text-align: left; padding: 0 0 18px; }
  .step:last-child { padding-bottom: 0; }
  /* Same semantics as desktop — the connector belongs to the step it leads INTO,
     so every is-done / is-cancelled colour rule above keeps working unchanged. */
  .step::before {
    top: -18px;
    left: 15px;
    right: auto;
    width: 2px;
    height: 18px;
  }
  .step-dot { margin: 0; }
  .step-label { padding-top: 6px; }
  .order-meta th { width: 45%; }
}

/* ============================================================
   Orders list — orders.html
   ============================================================ */

/* "placed" had no rule, so it rendered identical to "delivered". A list of
   pills has to tell them apart, so it gets its own neutral tone here — and
   order.html inherits the same fix. */
.status-pill[data-status="placed"] { background: #EEF1F6; color: #41506B; }
/* Card payment not confirmed by Stripe yet (amber, "your move"), and abandoned before
   payment (muted — nothing was charged, so it is not the red of a refunded cancel). */
.status-pill[data-status="awaiting_payment"] { background: #FFF4E0; color: #8A5200; }
.status-pill[data-status="payment_cancelled"] { background: var(--bg-soft); color: var(--muted); }

/* Every pixel of chrome above the list is one fewer order on screen: this page
   is a work queue, not a landing page. */
.orders-page { padding: 20px 0 56px; }
.orders-page .breadcrumbs { margin-bottom: 12px; }
.orders-head { margin-bottom: 16px; }
.orders-head h1 { font-size: 28px; letter-spacing: -0.02em; }

.orders-tabs { margin-bottom: 16px; }
/* .tabs is display:flex, which beats [hidden] — a buyer-only account hides the
   whole strip (and its bottom rule) rather than showing a lone tab. */
.orders-tabs[hidden] { display: none; }

/* ---- Toolbar: status chips on the left, search + sort on the right ---- */
.orders-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.orders-toolbar[hidden] { display: none; }
.orders-filters { flex: 1 1 auto; }
.orders-filters .chip-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted);
  transition: color var(--ease);
}
.orders-filters .chip:hover .chip-count { color: inherit; }
.orders-filters .chip[aria-pressed="true"] .chip-count { color: rgba(255, 255, 255, .72); }

.orders-tools { display: flex; align-items: center; gap: 12px; flex: none; }
.orders-search { position: relative; display: inline-flex; align-items: center; }
.orders-search svg {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.orders-search input {
  width: 240px;
  height: 40px;
  padding: 0 16px 0 40px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.orders-search input::placeholder { color: var(--muted); }
.orders-search input:hover { border-color: #CFCFE0; }
.orders-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.orders-search input::-webkit-search-cancel-button { cursor: pointer; }

.orders-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.orders-sort select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease);
}
.orders-sort select:hover { border-color: var(--brand); color: var(--brand); }
.orders-sort select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---- The list ---- */
.orders-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.orders-list[hidden] { display: none; }

/* The row is an <li>, not an <a>: it has to be able to hold a real <button>.
   The title anchor stretches across it (see .order-row-title::after).
   Two lines of text beside a 40px thumb — a queue you can scan, not a stack of
   cards you scroll one at a time. */
.order-row {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
  color: inherit;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
/* A -1px lift needs a shadow you can see: --shadow-card is the *resting* one. */
.order-row:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.order-row:has(:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

.order-row-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--r-input);
  display: grid;
  place-items: center;
  color: #fff;
}
.order-row-thumb svg { width: 20px; height: 20px; }

.order-row-text { min-width: 0; }
/* Inline on the sub-line now — a full line of its own bought nothing. */
.order-row-ref { font-variant-numeric: tabular-nums; }
.order-row-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  transition: color var(--ease);
}
/* Stretched link: the whole card is clickable, the CTA button (z-index above)
   still gets its own clicks. */
.order-row-title::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-card); }
.order-row:hover .order-row-title { color: var(--brand); }
.order-row-sub {
  /* Must be block: an inline span ignores overflow/text-overflow, so a long
     buyer name stretched the row past the viewport at 375px. */
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-row-sub strong { color: var(--body); font-weight: 600; }
/* Counterparty avatar — the row's only cue for *who* without reading. */
.order-row-sub .avatar { vertical-align: -6px; margin-right: 8px; }

/* The buyer's note: the column that fills the dead space a right-stacked row
   left between the sub-line and the pill. One line, truncated. */
.order-row-note {
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-row-note:empty { border-left: 0; }

/* Due / Total / Status across, not stacked: three stacked lines made every row
   taller than its own thumbnail and left the width unused. */
.order-row-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  text-align: right;
}
/* Fixed-width columns, present only on lists that need them, so every row keeps
   the same tracks and the list reads down the page like a table. */
.order-row.has-note { grid-template-columns: 40px minmax(0, 1fr) minmax(0, .8fr) auto; }
.order-row.has-action { grid-template-columns: 40px minmax(0, 1fr) auto 92px; }
.order-row.has-note.has-action { grid-template-columns: 40px minmax(0, 1fr) minmax(0, .8fr) auto 92px; }
.order-row-action { display: flex; justify-content: flex-end; }
/* Above the stretched title link so Deliver/Accept stay clickable. */
.order-row-cta { position: relative; z-index: 1; }
.order-row-price {
  width: 76px;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
/* The deadline, not a decoration: an overdue order has to shout. */
.order-row-date { width: 84px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.order-row-date.is-late { color: var(--danger-ink); font-weight: 700; }
.order-row-date.is-soon { color: var(--ink); font-weight: 600; }
/* One width for every label, or the widest pill ("In progress") widens its own
   row's auto track and every column left of it shifts. */
.order-row-side .status-pill { width: 130px; justify-content: center; }

/* ---- Skeletons ---- */
.orders-skeleton { display: grid; gap: 8px; }
.orders-skeleton[hidden] { display: none; }
.orders-sk-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
}
.orders-sk-row .sk { display: block; height: 12px; }
.orders-sk-row .sk-thumb { width: 40px; height: 40px; border-radius: var(--r-input); }
/* Two lines, like the real row: title then sub. The third is folded away so the
   skeleton is the same height as what replaces it. */
.orders-sk-row .sk-lines .sk:nth-child(1) { width: 72%; height: 14px; }
.orders-sk-row .sk-lines .sk:nth-child(2) { width: 46%; height: 10px; margin-top: 6px; }
.orders-sk-row .sk-lines .sk:nth-child(3) { display: none; }
.orders-sk-row .sk-side { height: 24px; border-radius: var(--r-pill); }

/* ---- Empty / error ---- */
.orders-page .order-state h2 { font-size: 24px; font-family: var(--font-head); }

@media (max-width: 620px) {
  .orders-page { padding: 16px 0 48px; }
  .orders-head h1 { font-size: 24px; }
  /* Search and sort share one row under the chips: at 375px a wrapping toolbar
     ate 250px before the first order. */
  .orders-tools { margin-left: 0; width: 100%; flex-wrap: nowrap; }
  .orders-search { flex: 1 1 140px; min-width: 0; }
  .orders-search input { width: 100%; }
  .orders-sort { flex: none; }

  .order-row, .order-row.has-action, .order-row.has-note,
  .order-row.has-note.has-action, .orders-sk-row {
    grid-template-columns: 40px minmax(0, 1fr);
    row-gap: 10px;
    padding: 10px 14px;
  }
  /* The note is the first thing to go on a phone — the row is already two lines. */
  .order-row-note { display: none; }
  .order-row-thumb, .orders-sk-row .sk-thumb { width: 40px; height: 40px; }
  .order-row-side, .orders-sk-row .sk-side {
    grid-column: 1 / -1;
    width: 100%;
    text-align: left;
  }
  /* Flex + wrap so the date drops to its own line intact rather than breaking
     mid-phrase when pill + price + date can't share one row. */
  .order-row-side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
  }
  /* Nothing to line up with on one-column rows, and the desktop track widths are
     exactly what tip date + total + pill onto two lines at 375px. */
  .order-row-side .status-pill,
  .order-row-date,
  .order-row-price { width: auto; }
  /* Full-width CTA on its own line — a 100px column has nowhere to go at 375px. */
  .order-row-action { grid-column: 1 / -1; }
  .order-row-action:empty { display: none; }
  .order-row-cta { width: 100%; }
  .orders-sk-row .sk-side { height: 16px; }
}

/* ============================================================
   Seller dashboard — dashboard.html
   Reuses .order-state (page-level empty/error card), .sk (shimmer),
   .inline-error and .status-pill from the sections above.
   ============================================================ */
.dash-page { padding: 32px 0 48px; }

/* ---- Boot skeleton ---- */
.dash-boot[hidden] { display: none; }
.dash-sk-head { display: grid; gap: 12px; margin-bottom: 24px; }
.dash-sk-head .sk:first-child { height: 40px; width: 30%; }
.dash-sk-head .sk:last-child { height: 20px; width: 48%; }
.dash-sk-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  padding: 32px;
  border-radius: var(--r-card);
  background: var(--bg-soft);
  margin-bottom: 24px;
}
/* Every skeleton block is sized to the block it stands in for — the page used to
   drop ~600px when the promises resolved. */
.dash-sk-hero .sk { height: 108px; }
.dash-sk-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 32px; }
.dash-sk-tiles .sk { height: 132px; border-radius: var(--r-card); }
.dash-sk-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  margin-bottom: 24px;
}
.dash-sk-panel .sk { height: 56px; }
/* First bar is the panel head, the rest are rows. */
.dash-sk-panel .sk:first-child { height: 24px; width: 32%; }

/* ---- Shared card shell + hints ---- */
.dash-card {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.field-hint { font-size: 13px; color: var(--muted); line-height: 1.5; }
.dash-fineprint { font-size: 13px; color: var(--muted); text-align: center; margin-top: 12px; }

/* ---- Onboarding ---- */
.dash-onboard[hidden] { display: none; }
.dash-onboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 480px;
  gap: 48px;
  align-items: start;
  padding: 40px 0 24px;
}
.dash-onboard-intro .badge-accent { margin-bottom: 16px; }
.dash-onboard-intro h1 { font-size: 40px; letter-spacing: -0.02em; margin-bottom: 12px; }
.dash-onboard-intro > p { font-size: 17px; color: var(--body); max-width: 52ch; }
.dash-onboard-points { display: grid; gap: 12px; margin-top: 24px; padding: 0; list-style: none; }
.dash-onboard-points li {
  position: relative;
  padding-left: 30px;
  font-size: 15px;
  color: var(--body);
  line-height: 1.55;
}
.dash-onboard-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  /* checkmark */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm5 7.4l-6.1 6.1a1 1 0 0 1-1.4 0L6.9 13a1 1 0 1 1 1.4-1.4l1.9 1.9 5.4-5.5A1 1 0 0 1 17 9.4z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm5 7.4l-6.1 6.1a1 1 0 0 1-1.4 0L6.9 13a1 1 0 1 1 1.4-1.4l1.9 1.9 5.4-5.5A1 1 0 0 1 17 9.4z'/%3E%3C/svg%3E") center/contain no-repeat;
  background-color: var(--success-ink);
}
.dash-onboard-form { padding: 28px; }
.dash-onboard-form .field textarea { min-height: 120px; }
.dash-onboard-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-onboard-form .inline-error { margin-bottom: 16px; }

/* ---- Page head ---- */
.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.dash-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.dash-head h1 { font-size: 34px; letter-spacing: -0.02em; }
.dash-sub { font-size: 15px; color: var(--muted); margin-top: 6px; max-width: 56ch; }
.dash-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-head-actions .btn svg { width: 17px; height: 17px; }

/* ---- Earnings hero ---- */
.dash-hero {
  background: var(--hero-grad);
  border-radius: var(--r-card);
  padding: 32px;
  margin-bottom: 24px;
}
.dash-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.dash-figure { min-width: 0; padding-left: 24px; border-left: 2px solid rgba(255, 255, 255, .14); }
.dash-figure:first-child { padding-left: 0; border-left: 0; }
.dash-figure-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .66);
}
.dash-figure-value {
  font-family: var(--font-head);
  font-size: 38px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 8px 0 6px;
  font-variant-numeric: tabular-nums;
}
.dash-figure-note { font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, .72); }
.dash-figure--accent .dash-figure-label { color: var(--accent); }
.dash-figure--accent .dash-figure-value { font-size: 46px; color: var(--accent); }
.dash-figure--accent .dash-figure-note { color: rgba(255, 255, 255, .82); }

/* ---- Stat tiles ---- */
.dash-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.dash-tile {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
  padding: 20px;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.dash-tile:hover { border-color: var(--brand-wash); box-shadow: var(--shadow-card); transform: translateY(-2px); }
.dash-tile-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.dash-tile-value {
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
.dash-tile-note { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* ---- Panels ---- */
.dash-panel { padding: 0; margin-bottom: 24px; overflow: hidden; }
.dash-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.dash-panel-head h2 { font-size: 19px; }
.dash-panel-head p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.dash-panel .inline-error { margin: 16px 24px 0; }

/* ---- Gigs table ---- */
/* Right-edge shadow, pinned to the element and covered by the (content-anchored)
   white layer once you reach the end: between 640px and ~700px the table still
   scrolls, and an unhinted horizontal scroll is a trap. */
.dash-scroll {
  overflow-x: auto;
  background:
    linear-gradient(to left, var(--bg), rgba(255, 255, 255, 0)) right / 24px 100% no-repeat local,
    linear-gradient(to left, rgba(14, 14, 26, .13), rgba(14, 14, 26, 0)) right / 24px 100% no-repeat scroll;
}
.dash-scroll[hidden] { display: none; }
.dash-scroll:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.dash-table { width: 100%; border-collapse: collapse; min-width: 660px; }
.dash-table th, .dash-table td { text-align: left; padding: 16px; vertical-align: middle; }
.dash-table thead th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.dash-table th:first-child, .dash-table td:first-child { padding-left: 24px; }
.dash-table th:last-child, .dash-table td:last-child { padding-right: 24px; }
.dash-table tbody tr { border-bottom: 1px solid var(--line); transition: background var(--ease); }
.dash-table tbody tr:last-child { border-bottom: 0; }
.dash-table tbody tr:hover { background: var(--bg-soft); }
.dash-table tbody th { font-weight: 400; }
.dash-num { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

.dash-gig-link { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dash-gig-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: var(--r-btn); }
.dash-swatch {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
}
.dash-swatch svg { width: 19px; height: 19px; }
.dash-gig-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  max-width: 42ch;
  transition: color var(--ease);
}
.dash-gig-link:hover .dash-gig-title { color: var(--brand); }
.dash-gig-cat { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.dash-newtag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--brand-tint);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}

/* Gig statuses ride the same pill as order statuses. */
.status-pill[data-status="active"] { background: #E6F7EF; color: var(--success-ink); }
.status-pill[data-status="paused"] { background: var(--bg-soft); color: var(--muted); }

.dash-row-actions { white-space: nowrap; text-align: right; }
.dash-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--body);
  padding: 6px 10px;
  border-radius: var(--r-btn);
  transition: color var(--ease), background var(--ease);
}
.dash-action:hover { color: var(--brand); background: var(--brand-tint); }
.dash-action:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.dash-action.is-danger:hover { color: #B4262A; background: var(--danger-wash); }
.dash-action[data-armed="1"] { color: #fff; background: var(--danger); }
.dash-action[data-armed="1"]:hover { color: #fff; background: #C93B3F; }
.dash-action[disabled] { opacity: .55; cursor: default; }

/* ---- Empty states inside panels ---- */
.dash-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 48px 24px 52px;
}
.dash-empty[hidden] { display: none; }
.dash-empty svg { width: 40px; height: 40px; color: var(--brand); opacity: .5; }
.dash-empty h3 { font-size: 18px; margin-top: 4px; }
.dash-empty p { font-size: 14px; color: var(--muted); max-width: 46ch; line-height: 1.55; }
.dash-empty .btn { margin-top: 10px; }

/* ---- Recent orders ---- */
.dash-orders { list-style: none; padding: 0; margin: 0; }
.dash-orders[hidden] { display: none; }
.dash-order + .dash-order { border-top: 1px solid var(--line); }
.dash-order > a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  transition: background var(--ease);
}
.dash-order > a:hover { background: var(--bg-soft); }
.dash-order > a:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.dash-order-text { flex: 1; min-width: 0; }
.dash-order-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-order > a:hover .dash-order-title { color: var(--brand); }
.dash-order-meta {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-order-right { flex: none; display: flex; align-items: center; gap: 16px; }
.dash-order-price { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- Needs your attention ---- */
.dash-due { font-size: 13px; color: var(--muted); white-space: nowrap; }
.dash-due.is-late { color: var(--danger-ink); font-weight: 700; }
.dash-todo-cta { font-size: 14px; font-weight: 600; color: var(--brand); white-space: nowrap; }
.dash-order > a:hover .dash-todo-cta { text-decoration: underline; }
.dash-todo-clear { padding: 20px 24px 24px; font-size: 14px; color: var(--muted); }
.dash-todo-clear[hidden] { display: none; }

/* ---- Create / edit gig dialog ---- */
.dash-dialog {
  width: min(660px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 28px;
  border: 0;
  border-radius: 16px;
  background: var(--bg);
  color: var(--body);
  box-shadow: var(--shadow-hover);
  overflow-y: auto;
}
.dash-dialog::backdrop { background: rgba(14, 14, 26, .55); }
.dash-dialog .modal-head { margin-bottom: 24px; }
.dash-dialog-h3 { font-size: 16px; margin: 24px 0 4px; }
.dash-dialog-hint { margin-bottom: 16px; }
.dash-dialog .inline-error { margin: 4px 0 16px; }
.dash-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.dash-dialog-actions .btn { flex: none; }
#gd-packages[hidden] { display: none; }

.pkg-row {
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  padding: 16px 16px 4px;
  margin-bottom: 16px;
}
.pkg-row legend {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  padding: 0 6px;
}
.pkg-hint { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.pkg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* ---- Responsive ---- */
@media (max-width: 1080px) {
  .dash-onboard { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .dash-onboard-form { max-width: 620px; }
}
@media (max-width: 900px) {
  .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-sk-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .dash-figure { padding-left: 0; border-left: 0; padding-top: 20px; border-top: 2px solid rgba(255, 255, 255, .14); }
  .dash-figure:first-child { padding-top: 0; border-top: 0; }
  .dash-sk-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .dash-page { padding: 20px 0 56px; }
  .dash-head h1 { font-size: 26px; }
  .dash-head-actions { width: 100%; }
  .dash-head-actions .btn { flex: 1; justify-content: center; }
  .dash-hero { padding: 24px 20px; }
  .dash-figure-value { font-size: 32px; }
  .dash-figure--accent .dash-figure-value { font-size: 36px; }
  .dash-onboard { padding: 24px 0 16px; }
  .dash-onboard-intro h1 { font-size: 30px; }
  .dash-onboard-form { padding: 20px 16px; }
  .dash-onboard-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .dash-panel-head { padding: 16px; }
  .dash-panel .inline-error { margin: 16px 16px 0; }
  .dash-order > a { padding: 16px; gap: 12px; }
  .dash-order-right { flex-direction: column; align-items: flex-end; gap: 4px; }
  .dash-todo-clear { padding: 16px; }
  .dash-dialog { padding: 20px 16px; max-height: 100dvh; border-radius: 14px; }

  /* The gigs table becomes stacked cards. A 660px-wide table inside a 375px
     viewport put Status and the Edit/Delete buttons off-screen behind an
     invisible horizontal scroll — the actions have to stay reachable. */
  .dash-scroll { overflow-x: visible; background: none; }
  .dash-table { min-width: 0; display: block; }
  .dash-table thead { display: none; }
  .dash-table tbody { display: block; }
  .dash-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 16px;
  }
  .dash-table tbody th, .dash-table tbody td { display: block; padding: 0; }
  .dash-table th:first-child, .dash-table td:first-child { padding-left: 0; }
  .dash-table th:last-child, .dash-table td:last-child { padding-right: 0; }
  .dash-table tbody th { flex: 1 0 100%; }
  .dash-gig-title { max-width: none; }
  .dash-row-actions {
    flex: 1 0 100%;
    text-align: left;
    margin: 4px -10px -6px;   /* cancel the buttons' own padding so they align left */
  }
  .pkg-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* The receipt's "where every cent ended up" group — the same money as the rows
   above it, regrouped by who is holding it. A rule marks the seam so the two are
   not read as one continuous list of movements. */
.receipt-row.is-split { margin-top: 10px; padding-top: 14px; border-top: 2px solid var(--line); }

/* The orders list shows the buyer their real charge and the seller their real
   payout, not the bare price, so each amount carries the fee that explains it.
   The column grows to fit the sub-line rather than clipping it — a truncated fee
   disclosure is the same as no fee disclosure. */
.order-row-price { width: 112px; line-height: 1.25; }
.order-row-fee {
  display: block;
  margin-top: 3px;
  font-family: var(--font-body, inherit);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
/* Matches the one-column breakpoint above, where the side column stops being a
   fixed track at all. */
@media (max-width: 620px) { .order-row-price { width: auto; } }

/* ---- Earnings hero: five figures, not three ----
   Balance, gross, the processing deducted from it, the net that arrives and the 0%
   commission line are five separate numbers, because collapsing any of them into
   another is exactly what made the old "you keep 100%" stat wrong.

   The divider is a leading border on each cell, so it has to be cleared at the START
   OF EVERY ROW, not only on the first cell — otherwise a wrapped row opens with a
   rule hanging off its left edge. Hence one nth-child reset per column count. */
.dash-hero-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; }
.dash-figure { padding-left: 20px; }
.dash-figure-value { font-size: 28px; }

@media (max-width: 1180px) {
  .dash-hero-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 26px; }
  .dash-figure:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
}
/* At 900 the base sheet has already swapped the left rules for top ones and gone to
   one column; two fit comfortably down to phone width, so re-assert that and move
   the reset to the first cell of each row. */
@media (max-width: 900px) {
  .dash-hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 26px; }
  .dash-figure { padding-left: 0; border-left: 0; padding-top: 20px; border-top: 2px solid rgba(255, 255, 255, .14); }
  .dash-figure:nth-child(-n + 2) { padding-top: 0; border-top: 0; }
}
@media (max-width: 560px) {
  .dash-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-figure:nth-child(2) { padding-top: 20px; border-top: 2px solid rgba(255, 255, 255, .14); }
  .dash-figure:first-child { padding-top: 0; border-top: 0; }
}

/* ---------------------------------------------------------------------------
   Delivered work + the seller's delivery composer (order.html)
   --------------------------------------------------------------------------- */

.delivery-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; list-style: none; margin: 0; padding: 0; }

.delivery-entry {
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  background: var(--bg-soft);
  padding: 16px 18px;
}
/* Newest first, so the top entry is the one being looked at. */
.delivery-entry:first-child { background: var(--bg); border-color: var(--brand-wash); }

.delivery-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 8px;
}
.delivery-rev { font-size: 13px; font-weight: 700; color: var(--ink); }
.delivery-when { font-size: 12px; color: var(--muted); }

/* Seller-written prose. pre-wrap keeps the line breaks they typed; overflow-wrap
   stops one 400-character word from widening the card past the viewport. */
.delivery-message {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0 0 10px;
}
.delivery-message.is-empty { color: var(--muted); font-style: italic; white-space: normal; }
.delivery-nofiles { font-size: 13px; color: var(--muted); margin: 0; }

/* minmax(0, 1fr): a grid track sizes to min-content by default, and a 200-character
   filename's min-content is 200 characters wide. Without this the row — and with it the
   whole document — is as wide as the longest name a seller ever picked, which on a phone
   is a horizontally scrolling page. The same reason `min-width: 0` appears on every flex
   item below that holds a name. */
.delivery-files { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; list-style: none; margin: 0; padding: 0; }
.delivery-file {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  background: var(--bg);
  padding: 8px 12px;
}
.delivery-file-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 14px;
  font-weight: 600;
}
.delivery-file-link svg { width: 16px; height: 16px; flex: none; }
/* A filename is attacker-supplied and can be 200 characters of anything. Truncate it
   visually rather than letting it set the card's width. */
.delivery-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delivery-file-size { font-size: 12px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
/* A file whose bytes were removed under the retention policy: the name stays as the
   record of what arrived, in body colour rather than link colour, and the sentence that
   says why wraps under it instead of setting the row's width. */
.delivery-file.is-purged { flex-wrap: wrap; background: var(--bg-soft); }
.delivery-file.is-purged .delivery-file-link { color: var(--muted); font-weight: 500; }
.delivery-file.is-purged .delivery-file-size { flex: 1 1 100%; }

/* ---- composer ---- */
.delivery-form .field:last-of-type { margin-bottom: 8px; }
.delivery-form input[type="file"] {
  width: 100%;
  font-size: 14px;
  color: var(--body);
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r-input);
  background: var(--bg-soft);
}
.delivery-form input[type="file"]:disabled { opacity: .55; }

.delivery-picks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; list-style: none; margin: 0 0 14px; padding: 0; }
.delivery-picks[hidden] { display: none; }
.delivery-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  padding: 8px 8px 8px 12px;
  font-size: 14px;
}
.delivery-pick svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.delivery-pick-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delivery-pick-size { font-size: 12px; color: var(--muted); flex: none; max-width: 45%; font-variant-numeric: tabular-nums; }
/* A file the server would refuse. Said here, before the upload, not after it. */
.delivery-pick.is-bad { border-color: var(--danger); background: var(--danger-wash); }
.delivery-pick.is-bad .delivery-pick-size { color: var(--danger-ink); font-variant-numeric: normal; }
.delivery-pick-x {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--r-input);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.delivery-pick-x:hover { background: var(--bg-soft); color: var(--danger-ink); }

.delivery-progress { margin-bottom: 14px; }
.delivery-progress[hidden] { display: none; }
.delivery-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}
.delivery-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width var(--ease);
}
.delivery-progress-text { font-size: 13px; color: var(--muted); margin: 6px 0 0; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .delivery-bar > span { transition: none; }
}
