/*
 * css/pages/requests.css: /requests and /request/<id> (SPEC 5.2). Tokens only (css/tokens.css); the buttons, fields,
 * chips, band, stat cards, tabs, states, cards and FAQ come from css/site.css untouched. Designed at 360px first.
 * Sections: head and flow, band, your board, board head and tools, tabs, rows (head), rows (body), the post dialog,
 * how and FAQ.
 * One shared piece site.css lacks: .chip--won, the settled accent chip of an awarded request.
 */

.chip--won { color: var(--accent); background: var(--accent-tint); border-color: var(--accent-line); }

/* ------------------------------------------------------------------------------------------------ head */
.rq-head {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: end;
  padding-block: calc(var(--section) * .75) calc(var(--section) * .45);
}
.rq-head__copy { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; min-width: 0; }
.rq-head__copy .kicker { margin-bottom: -6px; }
.rq-head__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.rq-flow {
  list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r3); overflow: hidden;
}
.rq-flow li { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--panel); min-width: 0; }
.rq-flow__n { font: 600 12px/1.4 var(--font-mono); letter-spacing: .12em; color: var(--accent); }
.rq-flow__t { font: 400 24px/1.1 var(--font-display); color: var(--text); letter-spacing: 0; }
.rq-flow__d { font-size: 13.5px; line-height: 1.45; color: var(--muted); }
@media (min-width: 1024px) {
  .rq-head { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; }
}
/* on phones the four steps wait for "How a request works" below: the numbers come straight after the buttons */
@media (max-width: 639px) { .rq-flow { display: none; } }

/* ------------------------------------------------------------------------------------------------ band */
.rq-band-wrap { display: flex; flex-direction: column; gap: 10px; }
.rq-band__note { align-self: flex-end; text-align: right; max-width: 72ch; }
@media (max-width: 819px) { .rq-band__note { align-self: flex-start; text-align: left; } }
/* one column on small phones: label left, value right, so the four figures stay one screen */
@media (max-width: 399px) {
  .rq-band > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 18px; }
  .rq-band dd { margin-top: 0; text-align: right; font-size: 16px; }
}

/* ------------------------------------------------------------------------------------------------ your board */
.rq-mine { padding-top: calc(var(--section) * .45); display: flex; flex-direction: column; gap: 16px; }
.rq-mine__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; }
.rq-mine__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 820px) { .rq-mine__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rq-mine__stat { gap: 8px; }
.rq-mine__stat .stat__value { font-size: 22px; }
.rq-mine__stat .btn { align-self: flex-start; margin-top: 6px; }
.rq-mine__stat .btn--quiet { min-height: 36px; font-size: 14.5px; }

/* ------------------------------------------------------------------------------------------------ board head */
.rq-board { padding-block: calc(var(--section) * .55) var(--section); display: flex; flex-direction: column; gap: 20px; }
.rq-board__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.rq-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; min-width: 0; max-width: 100%; }
.rq-tools__mine { min-height: 44px; }
.rq-tools__sort { display: flex; align-items: center; gap: 10px; }
.rq-tools__sort .select { width: auto; min-width: 176px; height: 42px; font-size: 15px; }
@media (max-width: 639px) {
  .rq-tools { width: 100%; justify-content: space-between; }
  .rq-tools__sort { flex: 1 1 200px; }
  .rq-tools__sort .select { flex: 1; min-width: 0; height: 44px; }
}
.rq-link-note { font-size: 14.5px; }
.rq-board__note:empty { display: none; }

/* tabs: the line tabs of site.css, with a count */
.rq-tabs { gap: 28px; }
.rq-tabs [role="tab"] { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; font-size: 16px; }
.rq-tabs__n {
  display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: var(--r-pill);
  background: var(--panel-2); color: var(--dim); font: 600 12px/1 var(--font-mono); font-variant-numeric: tabular-nums;
}
.rq-tabs [aria-selected="true"] .rq-tabs__n { background: var(--accent-tint); color: var(--accent); }
.rq-panel { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.rq-panel.is-state > [data-list] > .state { max-width: 760px; }
.rq-panel.is-state .rq-cols { display: none; }

/* ------------------------------------------------------------------------------------------------ rows: head */
/*
 * Phone: the title block and the bounty share the first line, the three figures wrap under them with the chevron.
 * From 1024px the row is a table: request, backers, deadline, proposals, bounty, and .rq-cols labels the columns.
 */
.rq-rows { list-style: none; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r3); background: var(--panel); overflow: hidden; }
.rq { border-bottom: 1px solid var(--line-row); min-width: 0; }
.rq:last-child { border-bottom: 0; }
.rq--sk { padding: 18px 16px; }
.rq--sk .skeleton i:nth-child(2) { height: 16px; }

.rq__toggle {
  width: 100%; display: grid; text-align: left; align-items: start;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "main bounty" "meta chev";
  gap: 12px 16px; padding: 16px; color: inherit;
  transition: background-color var(--t2);
}
.rq__toggle:hover { background: var(--panel-2); }
.rq__toggle:focus-visible { outline-offset: -2px; }
.rq.is-open > .rq__toggle { background: var(--panel-2); }
.rq__main { grid-area: main; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rq__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 24px; }
.rq__id { font: 500 12px/1.4 var(--font-mono); color: var(--faint); letter-spacing: .04em; font-variant-numeric: tabular-nums; margin-right: 2px; }
.rq__title { font: 700 17px/1.35 var(--font-body); letter-spacing: -0.01em; color: var(--text); overflow-wrap: anywhere; unicode-bidi: isolate; }
.rq__detail {
  font-size: 14.5px; line-height: 1.5; color: var(--body); unicode-bidi: isolate;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rq__meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; min-width: 0; }
.rq__cell { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1.4 var(--font-mono); color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rq__cell .icon { color: var(--muted); }
.rq--open .rq__cell--time { color: var(--text); }
.rq__bounty { grid-area: bounty; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; white-space: nowrap; padding-top: 1px; }
.rq__bounty strong { font: 600 18px/1.2 var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.rq__unit { font: 600 11px/1.3 var(--font-mono); letter-spacing: .1em; color: var(--muted); }
.rq--reclaimed .rq__bounty strong { color: var(--dim); }
.rq__chev { grid-area: chev; justify-self: end; align-self: center; display: grid; place-items: center; width: 28px; height: 28px; color: var(--muted); transition: transform var(--t2) var(--ease-out); }
.rq.is-open .rq__chev { transform: rotate(180deg); color: var(--text); }

/* the column labels, and the row as a table, from 1024px */
.rq-cols { display: none; }
@media (min-width: 1024px) {
  .rq-cols, .rq__toggle {
    grid-template-columns: minmax(0, 1fr) 104px 148px 112px 136px 28px;
    grid-template-areas: none;
    column-gap: 16px;
  }
  .rq-cols {
    display: grid; padding: 0 24px 10px;
    font: 600 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  }
  .rq-cols .r { text-align: right; }
  .rq__toggle { align-items: center; padding: 18px 24px; }
  .rq__main, .rq__meta > *, .rq__bounty, .rq__chev { grid-area: auto; grid-row: 1; }
  .rq__main { grid-column: 1; }
  .rq__meta { display: contents; }
  .rq__cell .icon { display: none; }
  .rq__cell--backers { grid-column: 2; }
  .rq__cell--time { grid-column: 3; white-space: normal; }
  .rq__cell--props { grid-column: 4; }
  .rq__bounty { grid-column: 5; flex-direction: row; align-items: baseline; justify-content: flex-end; gap: 6px; padding-top: 0; }
  .rq__chev { grid-column: 6; }
  .rq--sk { padding: 20px 24px; }
}
@media (min-width: 1280px) {
  .rq-cols, .rq__toggle { grid-template-columns: minmax(0, 1fr) 120px 168px 124px 150px 28px; column-gap: 20px; }
}

/* ------------------------------------------------------------------------------------------------ rows: body */
.rq__body { padding: 4px 16px 24px; background: var(--panel-2); border-top: 1px solid var(--line-row); }
.rq__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 16px; }
@media (min-width: 1024px) {
  .rq__body { padding: 8px 24px 28px; }
  .rq__grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas: "detail side" "props side" "backers side" "hist side";
    gap: 20px 28px; align-items: start;
  }
  .rq-sec--detail { grid-area: detail; }
  .rq-side { grid-area: side; }
  .rq-sec--props { grid-area: props; }
  .rq-sec--backers { grid-area: backers; }
  .rq-sec--hist { grid-area: hist; }
}
.rq-sec { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--r3); background: var(--panel); }
.rq-sec__h { display: flex; align-items: center; gap: 8px; font: 600 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.rq-sec__n {
  display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--panel-2); color: var(--dim); font: 600 11px/1 var(--font-mono); letter-spacing: 0;
}
.rq-sec__lead { font-size: 14px; line-height: 1.5; color: var(--muted); }
.rq-none { font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.rq-text { font-size: 15.5px; line-height: 1.65; color: var(--dim); white-space: pre-line; overflow-wrap: anywhere; unicode-bidi: isolate; }
.rq-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* facts and actions, the right column */
.rq-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rq-facts { display: flex; flex-direction: column; padding: 6px 18px; border: 1px solid var(--line); border-radius: var(--r3); background: var(--panel); }
.rq-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line-row); min-width: 0; }
.rq-facts > div:last-child { border-bottom: 0; }
.rq-facts dt { font: 600 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.rq-facts dd { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; font-size: 14.5px; color: var(--dim); min-width: 0; overflow-wrap: anywhere; margin-left: auto; }
.rq-facts dd .mono { font-size: 14px; color: var(--text); }
.rq-facts__sub { font: 400 12px/1.4 var(--font-mono); color: var(--faint); }

.rq-act { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--accent-line); border-radius: var(--r3); background: var(--panel); }
.rq-act__block { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-row); }
.rq-act .rq-sec__h + .rq-act__block { padding-top: 0; border-top: 0; }
.rq-act__block--you { padding: 14px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--panel-3); }
.rq-act .rq-sec__h + .rq-act__block--you { padding-top: 14px; border-top: 1px solid var(--line); }
.rq-act__t { font: 600 15px/1.4 var(--font-body); color: var(--text); }
.rq-act__p { font-size: 14.5px; line-height: 1.55; color: var(--dim); }
.rq-act__p--muted { color: var(--muted); }
.rq-act__block > .btn--sm { align-self: flex-start; }
.rq-act .field__label { color: var(--text); font-size: 15px; }
.rq-act .amount .input { height: 52px; font-size: 18px; }

/* people */
.rq-person { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.rq-person .mono { font-size: 13.5px; }
.rq-tag {
  font: 600 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  padding: 4px 6px; border-radius: var(--r1); background: var(--accent-tint);
}

/* proposals */
.rq-props { list-style: none; display: flex; flex-direction: column; }
.rq-prop { display: grid; grid-template-columns: 3px minmax(0, 1fr); gap: 4px 14px; padding: 12px 0; border-bottom: 1px solid var(--line-row); min-width: 0; }
.rq-prop:first-child { padding-top: 2px; }
.rq-prop:last-child { border-bottom: 0; padding-bottom: 0; }
.rq-prop .tone-bar { grid-row: 1 / span 2; }
.rq-prop__main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rq-prop__name { font: 600 16px/1.35 var(--font-body); color: var(--text); overflow-wrap: anywhere; unicode-bidi: isolate; align-self: flex-start; }
a.rq-prop__name { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: color var(--t1); }
a.rq-prop__name:hover { color: var(--accent); text-decoration-color: currentColor; }
.rq-prop__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13.5px; color: var(--muted); }
.rq-prop__by { display: inline-flex; align-items: center; gap: 6px; }
.rq-prop__sum { font-size: 14px; line-height: 1.5; color: var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: isolate; }
.rq-prop__side { grid-column: 2; display: flex; align-items: center; padding-top: 4px; }
.rq-prop.is-won .rq-prop__name { color: var(--accent); }
@media (min-width: 640px) {
  .rq-prop { grid-template-columns: 3px minmax(0, 1fr) auto; align-items: center; }
  .rq-prop .tone-bar { grid-row: auto; }
  .rq-prop__side { grid-column: 3; padding-top: 0; }
}

/* backers */
.rq-backers { list-style: none; display: flex; flex-direction: column; }
.rq-backers li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 48px; padding: 6px 0; border-bottom: 1px solid var(--line-row); }
.rq-backers li:last-child { border-bottom: 0; }
.rq-backers__amt { margin-left: auto; font-size: 14px; color: var(--text); }
.rq-all { align-self: flex-start; }
.rq-more { align-self: flex-start; min-height: 36px; font-size: 14.5px; }

/* history */
.rq-hist { list-style: none; display: flex; flex-direction: column; }
.rq-hist li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; border-bottom: 1px solid var(--line-row); }
.rq-hist li:last-child { border-bottom: 0; }
.rq-hist__age { font: 500 12px/1.4 var(--font-mono); color: var(--faint); font-variant-numeric: tabular-nums; }
.rq-hist__text { font-size: 14px; line-height: 1.5; color: var(--dim); overflow-wrap: anywhere; }
.rq-hist__tx { color: var(--muted); }
.rq-hist__tx:hover { color: var(--accent); }
.rq-hist-err { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }

/* ------------------------------------------------------------------------------------------------ post dialog */
.rq-post { display: flex; flex-direction: column; gap: 20px; }
.rq-post__intro { font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.rq-post .state { padding: 18px; }
.rq-count { font: 500 12px/1 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.rq-count.is-over { color: var(--danger); }
.rq-presets-wrap { display: flex; flex-direction: column; gap: 8px; }
.rq-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.rq-local:empty { display: none; }
.rq-review { padding: 14px 16px; border-radius: var(--r3); border: 1px solid var(--line); background: var(--panel-3); display: flex; flex-direction: column; gap: 10px; }
.rq-review__title { font: 600 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.rq-review__list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rq-review__list li { position: relative; padding-left: 18px; font-size: 14px; line-height: 1.5; color: var(--dim); }
.rq-review__list li::before { content: "/"; position: absolute; left: 0; color: var(--accent); font-family: var(--font-mono); }
.rq-sum__title { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------------------------------------ how, FAQ */
.rq-how__head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 40px; max-width: 820px; }
.rq-steps { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 640px) { .rq-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .rq-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rq-step { display: flex; flex-direction: column; gap: 12px; }
.rq-step .kicker { margin-bottom: 2px; }
.rq-step .h3 { font-size: 20px; }
.rq-faq .h2--s { margin-bottom: 28px; }
.rq-faq .faq { max-width: 880px; }

/* ------------------------------------------------------------------------------------------------ touch sizes */
@media (max-width: 819px) {
  .rq-mine__stat .btn--quiet, .rq-more { min-height: 44px; }
  .rq-hist__tx { width: 44px; height: 44px; }
  .rq-person .link, .rq-facts dd > a.link, a.rq-prop__name { display: inline-flex; align-items: center; min-height: 44px; }
  .rq-prop__main { gap: 2px; }
  .rq-backers li { padding: 2px 0; }
}

/* ------------------------------------------------------------------------------------------------ example layer */
/*
 * SPEC 1.3, 5.5 and js/pages/requests/example.js: sample requests under a tab's own state while the board is empty.
 * The frame, the banner, the chips and .example-action are css/site.css's, untouched; the rows are the live .rq rows.
 * This places the region under the state, brings back the column labels the state hides, and lays out the two pieces
 * a live row does not have: the six steps of a request, and a history whose transactions are text, not links.
 */
.rq-ex { margin-top: 24px; min-width: 0; }
.rq-ex[hidden] { display: none; }
@media (min-width: 1024px) { .rq-panel.is-state .rq-ex .rq-cols { display: grid; } }
.rq-ex__addr { color: var(--dim); overflow-wrap: anywhere; }

/* the life of a request, role by role */
.rq-ex-steps { list-style: none; display: flex; flex-direction: column; }
.rq-ex-step { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line-row); min-width: 0; }
.rq-ex-step:first-child { border-top: 0; padding-top: 2px; }
.rq-ex-step:last-child { padding-bottom: 0; }
.rq-ex-step__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; font: 600 11px/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rq-ex-step__n { color: var(--accent); font-variant-numeric: tabular-nums; }
.rq-ex-step__role { color: var(--text); }
.rq-ex-step__state { margin-left: auto; padding: 4px 7px; border-radius: var(--r1); background: var(--panel-2); color: var(--dim); letter-spacing: .08em; }
.rq-ex-step.is-now .rq-ex-step__state { color: var(--accent); background: var(--accent-tint); }
.rq-ex-step .example-action { width: 100%; }
.rq-ex-step .example-action .btn { width: auto; min-width: 112px; }
.rq-ex-step .example-action__reason { font-size: 13.5px; color: var(--dim); }
.rq-ex-step.is-later .example-action__reason, .rq-ex-step.is-closed .example-action__reason { color: var(--muted); }

/* history: the example transaction is plain text under the line on phones, beside it from 640px */
.rq-hist--ex li { grid-template-columns: 44px minmax(0, 1fr); gap: 2px 10px; padding: 8px 0; }
.rq-ex__tx { grid-column: 2; font-size: 12px; line-height: 1.4; color: var(--muted); white-space: nowrap; }
@media (min-width: 640px) {
  .rq-hist--ex li { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 4px 0; }
  .rq-ex__tx { grid-column: 3; }
}
