/* A proposal's page: status and timeline, what it does, its description, results and voters, the vote box and the discussion. Colours are the roles of
   theme.css, shared parts are in parts.css; this file draws only what the page itself is made of. */

.slot { display: contents; }
[data-slot="heading"] .ttl { align-items: flex-start; }
.pr-title { gap: 6px; flex: 1 1 420px; }
.pr-title h1 { overflow-wrap: anywhere; }
.pr-title .sub.row { gap: 4px 8px; }

/* results */
[data-slot="results"] .tiles { grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); }
[data-slot="results"] .tiles > .state { grid-column: 1 / -1; }
/* a result tile is one flex column, its label chip at the foot: it does not share rows with its neighbours as the tiles of other pages do (`parts.css`) */
[data-slot="results"] .tiles div.kpi { container-type: inline-size; display: flex; grid-template-rows: none; grid-row: auto; }
[data-slot="results"] .kpi .v { font-size: 21px; }
[data-slot="results"] .kpi .k .row { gap: 6px; flex-wrap: nowrap; }
/* the label chip of a result sits at the foot of its tile: a title is one line in every tile, so the values of a row are level in a narrow tile too */
[data-slot="results"] .kpi .k { display: contents; }
[data-slot="results"] .kpi .k .lab { order: 9; margin-top: auto; padding-top: 3px; align-self: flex-start; }
[data-slot="results"] .kpi .k .tip { top: auto; bottom: 40px; margin-top: 0; }
.kpi .fig .u { font-size: 12px; font-weight: 600; color: var(--dim); }
.kpi .v .st.big { font-size: inherit; }
.kpi .btns { margin-top: 6px; }
.meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; width: var(--w, 0%); border-radius: 3px; background: var(--barA); }
.meter i.b { background: var(--barB); }
.meter i.c { background: var(--barC); }
.meter i.ok { background: var(--ok); }
.meter i.warn { background: var(--warn); }

/* the page: the main column and the rail of the vote */
.layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.mainc { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.rail { flex: 1 1 320px; max-width: 360px; min-width: 0; }
.vote { position: sticky; top: 72px; }

/* the timeline */
.tl3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 0; }
.tl3 > div { padding: 12px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tl3 > div:last-child { border-right: 0; }

/* what this does */
.actn { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-bottom: 1px solid var(--line); }
.actn:last-child { border-bottom: 0; }
.actn .cell.top { align-items: flex-start; }
.idx { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--sel); color: var(--acct); font-weight: 700; font-size: 12px; flex: none; }
.acts { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.call { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.codeb { display: block; background: var(--head); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; overflow-wrap: anywhere; }
.inside { display: flex; flex-direction: column; gap: 8px; padding-left: 12px; border-left: 2px solid var(--line2); }
.quoted { overflow-wrap: anywhere; }
.flag { display: flex; gap: 8px; align-items: flex-start; border: 1px solid; border-radius: 8px; padding: 7px 10px; min-width: 0; overflow-wrap: anywhere; }
.flag .ic { margin-top: 2px; }
.flag .fl-b { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.fl-b .quoted { display: block; }
.flag.dng { background: var(--cau-bg); color: var(--cau-t); border-color: var(--bad); border-width: 2px; padding: 6px 9px; }
.flag.cau { background: var(--cau-bg); color: var(--cau-t); border-color: var(--cau-b); }
.flag.note { background: var(--sy-bg); color: var(--sy-t); border-color: var(--sy-b); }

/* the description: the Markdown subset, and the fold of a long one */
.desc { position: relative; }
.desc.fold[data-folded="true"] { max-height: 26em; overflow: hidden; }
.desc.fold[data-folded="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5em; background: linear-gradient(to bottom, transparent, var(--panel)); pointer-events: none; }
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 10px; line-height: 1.6; }
.md h3, .md h4, .md h5, .md h6 { font-size: 13px; margin: 14px 0 6px; font-weight: 700; line-height: 1.35; }
.md h3 { font-size: 14px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; line-height: 1.6; }
.md blockquote { margin: 0 0 10px; padding: 2px 0 2px 12px; border-left: 3px solid var(--line2); color: var(--dim); }
.md pre { margin: 0 0 10px; padding: 8px 10px; background: var(--head); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.md code { font-family: var(--mono); font-size: 12px; background: var(--head); border-radius: 4px; padding: 0 4px; }
.md pre code { background: none; padding: 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.md table { display: table; border-collapse: collapse; width: 100%; margin: 0 0 10px; }
.md th, .md td { padding: 6px 12px 6px 0; text-align: left; border-bottom: 1px solid var(--line); font-weight: 500; overflow-wrap: anywhere; }
.md th:last-child, .md td:last-child { padding-right: 0; }
.md th { color: var(--dim); font-size: 11.5px; }
.md .md-center { text-align: center; }
.md .md-right { text-align: right; font-variant-numeric: tabular-nums; }
.md-raw { white-space: pre-wrap; }
.ovv .md-link { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--acct); text-decoration: underline; text-align: left; }
.ovv .md-link.md-warn, .md-host.md-warn { color: var(--bad); }
.md-host { color: var(--dim); font-size: 12px; }
.linkask { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line2); border-radius: 8px; background: var(--head); padding: 8px 10px; overflow-wrap: anywhere; }

/* the voters */
.vlist { display: flex; flex-direction: column; }
.cardf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.cardf > span:first-child { min-width: 0; flex: 1 1 280px; overflow-wrap: anywhere; }
.reason { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.reason .lab { margin-left: 6px; }
.vlist .tb { min-width: 540px; }
.tr [role="cell"] .two { gap: 2px; }

/* the vote box */
.vote .card-b { gap: 10px; }
.vote .in { width: 100%; min-width: 0; min-height: 64px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; resize: vertical; }
.vote .in:focus-visible { border-color: var(--acc); }
.vote .btn.p, .vote .btns .btn { min-height: 40px; font-weight: 600; }
.vote .card-b > .btn.p { width: 100%; }
.vopts { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.vopt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 10px 4px; border: 1px solid var(--line2); border-radius: 10px; background: var(--panel); font-weight: 600; }
.vopt:hover { border-color: var(--acc); }
.vopt.for .ic:not(.sel) { color: var(--ok); }
.vopt.against .ic:not(.sel) { color: var(--bad); }
.ovv .vopt[aria-checked="true"] { border-width: 2px; padding: 9px 3px; background: var(--sel); border-color: var(--acc); color: var(--acct); }
.ovv .vopt.against[aria-checked="true"] { border-color: var(--bad); color: var(--bad); background: var(--cau-bg); }
.ovv .vopt.abstain[aria-checked="true"] { border-color: var(--dim); color: var(--text); background: var(--head); }
.vopt .sel { position: absolute; top: 4px; right: 4px; }
.vote .ovl { display: flex; flex-direction: column; gap: 12px; border: 2px solid var(--acc); border-radius: 10px; padding: 12px; background: var(--panel); }
.sum { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.sum dt { color: var(--dim); }
.sum dd { margin: 0; text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.vote .flag { align-items: flex-start; }
.vote .flag .lab { margin-left: 4px; }

@media (max-width: 899px) {
  .rail { max-width: none; flex-basis: 100%; order: -1; }
  .vote { position: relative; top: auto; }
}
@media (max-width: 599px) {
  .vlist .tb { min-width: 0; }
  .vlist .tr:not(.none) { grid-template-columns: minmax(88px, 1.2fr) 84px minmax(100px, 1fr); }
  .vlist .tr:not(.none) > :nth-child(4) { display: none; }
  .tl3 > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .tl3 > div:last-child { border-bottom: 0; }
  .pr-title { flex-basis: 100%; }
}
/* what changed in a listing since this device kept it (parts/listing-changes.js), on the Delegates tab and in the vote box */
.lchg { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lc { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 2px 0 2px 10px; border-left: 3px solid var(--line2); }
.lc.added { border-left-color: var(--ok); }
.lc.removed { border-left-color: var(--bad); }
.lc.changed { border-left-color: var(--warn); }
.lc.lc-more { border-left-style: dashed; color: var(--dim); }
.lc-k { font-weight: 600; }
.lc-l { min-width: 0; overflow-wrap: anywhere; }
/* the lines under a custom call (parts/custom-call.js): a contract's address is drawn in full and breaks where the box ends */
.cc, .cc .mono { min-width: 0; overflow-wrap: anywhere; }
