/* The requests board: people ask, people vote, the owner decides. Built on site.css (its tokens, .box, .tabs,
   .btn, .chip, .field); everything here is prefixed rq-. Square corners, 3px ink, hard shadows. */

.rq-page [hidden] { display: none !important; }

/* ------------------------------------------------------------ layout */
.rq-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: 'list side'; gap: 22px; align-items: start; }
.rq-col { grid-area: list; min-width: 0; }
.rq-side { grid-area: side; display: grid; gap: 18px; position: sticky; top: 76px; }
.rq-side section.box { margin-top: 0; }

/* tabs with counts, and the Top / New switch */
.rq-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.rq-tabs { margin-bottom: 0; }
.rq-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.rq-tabs a .n { font-size: 11px; min-width: 18px; padding: 0 3px; text-align: center; background: var(--card2); border: 1px solid var(--ink); color: var(--ink); }
.rq-tabs a.on .n { background: var(--gold); }
.rq-sort { display: flex; border: 2px solid var(--ink); background: var(--card); box-shadow: 2px 2px 0 var(--ink); }
.rq-sort a { font: 400 11px var(--display); padding: 5px 10px; text-decoration: none; }
.rq-sort a + a { border-left: 2px solid var(--ink); }
.rq-sort a:hover { background: var(--sky); color: var(--ink); }
.rq-sort a.on { background: var(--gold); color: var(--ink); }

/* ------------------------------------------------------------ the list */
.rq-list { display: grid; gap: 12px; transition: opacity .15s; }
.rq-list[aria-busy='true'] { opacity: .55; }
.rq-list > .rq-empty { margin: 0; background: var(--card); border: 3px solid var(--ink); box-shadow: var(--shadow); padding: 12px 14px; }

.rq { display: grid; grid-template-columns: 58px minmax(0, 1fr); background: var(--card); border: 3px solid var(--ink); box-shadow: var(--shadow); }
.rq.new { animation: rq-flash 1.8s ease-out; }
@keyframes rq-flash { from { background: #fff1a8; } }
.rq-main { display: grid; gap: 4px; align-content: start; padding: 10px 12px 9px; text-decoration: none; min-width: 0; }
.rq-main:hover { background: #fffdf3; color: var(--ink); }
.rq-main:hover .rq-t { color: var(--azure); }
.rq-t { font: 700 14px/1.3 var(--display); overflow-wrap: anywhere; }
.rq-b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; color: var(--ink); }
.rq-why { display: block; margin-top: 2px; padding: 1px 7px 2px; border-left: 4px solid var(--hot); background: #ffe6e2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 19px; }
.rq-why.note { border-left-color: var(--azure); background: #e4edfc; }
.rq-why b { font: 700 11px var(--display); }
.rq-meta { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; margin-top: 4px; color: var(--mute); font-size: 18px; }
.rq-meta time { margin-left: auto; font-size: 17px; }

/* status chips */
.chip.rs-open { background: var(--gold); color: var(--ink); }
.chip.rs-approved { background: var(--azure); color: var(--card); }
.chip.rs-done { background: var(--warm); color: var(--card); }
.chip.rs-denied { background: var(--hot); color: var(--card); }
.chip.yours { background: var(--card); }
.rq.rs-denied .rq-t, .rq.rs-done .rq-t { color: #4a4152; }

/* ------------------------------------------------------------ thumbs */
.rq-votes { display: flex; flex-direction: column; background: var(--card2); border-right: 3px solid var(--ink); }
.vote { --tf: var(--card); flex: 1; display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 52px; padding: 6px 2px; background: none; border: 0; color: var(--ink); font: 700 12px var(--display); cursor: pointer; }
.vote + .vote { border-top: 2px dotted var(--hair); }
.vote .thumb { display: block; transition: transform .08s steps(2); }
.vote .thumb .tf { fill: var(--tf); }
.vote .thumb .ti { fill: var(--ink); }
.vote:hover:not(:disabled) { background: var(--sky); }
.vote:hover:not(:disabled) .thumb { transform: translateY(-2px); }
.vote.down:hover:not(:disabled) .thumb { transform: translateY(2px); }
.vote:active:not(:disabled) .thumb { transform: none; }
.vote.up.on { background: var(--grass); color: var(--card); --tf: #d8f2c4; }
.vote.down.on { background: var(--coral); color: var(--card); --tf: #ffd9d3; }
.vote.on .n { text-shadow: 1px 1px 0 var(--ink); }
.vote:disabled { cursor: default; }
.vote:disabled:not(.on) { color: var(--mute); --tf: var(--card2); }
.vote:disabled .thumb .ti { fill: var(--mute); }
.vote.on:disabled .thumb .ti { fill: var(--ink); }

/* side by side, on a request's own page */
.rq-votes.row { flex-direction: row; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.rq-votes.row .vote { grid-auto-flow: column; gap: 8px; min-height: 0; min-width: 84px; padding: 8px 14px; font-size: 14px; }
.rq-votes.row .vote + .vote { border-top: 0; border-left: 3px solid var(--ink); }

/* ------------------------------------------------------------ the owner's row */
.rq-admin { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; border-top: 3px dashed var(--ink); background: var(--card2); }
.rq-admin .lbl { font: 700 10px var(--display); background: var(--plum); color: var(--card); padding: 2px 6px; margin-right: 2px; }
.rq-admin-box { margin-top: 20px; background: var(--card); border: 3px dashed var(--ink); padding: 0 0 2px; }
.rq-admin-box > .small { margin: 0; padding: 8px 10px 0; }
.rq-admin-box .rq-admin { border-top: 0; background: none; }

/* ------------------------------------------------------------ writing one */
.rq-write .field { margin-bottom: 10px; }
.rq-write .field small { text-align: right; }
.rq-write textarea { min-height: 96px; }
.rq-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; padding: 5px 8px; border: 2px solid var(--ink); background: var(--card2); font-size: 19px; }
.rq-who b { font: 700 12px var(--display); }
.rq-link { margin-left: auto; font: 400 11px var(--display); background: none; border: 0; padding: 2px 0; color: var(--azure); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.rq-link:hover { color: var(--hot); }
.rq-write .err:empty { display: none; }
.rq-write .err { margin: 8px 0 0; }
.rq-how .steps p { font-size: 19px; }

/* ------------------------------------------------------------ one request */
.rq-full { margin-top: 0; padding-bottom: 16px; }
.rq-full .box-h .chip { margin-left: auto; text-shadow: none; }
.rq-full-t { font-size: 24px; line-height: 1.25; margin: 4px 0 6px; overflow-wrap: anywhere; }
.rq-full > .rq-meta { margin: 0 0 12px; }
.rq-full-b { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 23px; line-height: 1.2; padding: 10px 12px; background: #fffdf6; border: 2px solid var(--hair); }
.rq-full-votes { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.rq-score { font: 400 12px var(--display); }
.rq-score b { font-size: 16px; margin-left: 4px; }
.rq-verdict .rq-reason { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 22px; margin: 0; }
.rq-verdict .small { margin-top: 10px; }

/* the owner's decision board */
.rq-modal .board { text-align: left; }
.rq-modal .rq-m-title { font: 700 13px/1.3 var(--display); overflow-wrap: anywhere; margin: 0 0 12px; }
.rq-modal .field { margin-bottom: 4px; }
.rq-modal .err:empty { display: none; }

/* ------------------------------------------------------------ narrow screens */
@media (max-width: 1100px) {
  .rq-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'side' 'list'; }
  .rq-side { position: static; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 720px) {
  .rq-side { grid-template-columns: minmax(0, 1fr); }
  .rq-how { display: none; }
  .rq-bar { gap: 8px; }
  .rq-tabs { gap: 5px; }
  .rq-tabs a { padding: 4px 7px; font-size: 12px; }
  .rq { grid-template-columns: 50px minmax(0, 1fr); }
  .vote { min-height: 48px; font-size: 11px; }
  .rq-main { padding: 9px 10px 8px; }
  .rq-t { font-size: 13px; }
  .rq-full-t { font-size: 20px; }
  .rq-full-b { font-size: 21px; padding: 8px 10px; }
  .rq-votes.row .vote { min-width: 72px; padding: 7px 10px; }
}
