/* A DAO's forum and official announcements, a forum thread with its replies, and a profile. Colours are the roles of theme.css. Every rule is under the root class of
   one of these pages (.forum, .frm-official, .frm-own, .thread, .profile), so no other page is touched; the narrow rules follow the 390px render: one column, a thread
   as a stack, the profile's rail under its main part. */

/* the forum: a head, the threads on one grid, a foot */
.forum .frm-b { display: flex; flex-direction: column; min-width: 0; }
.forum .frm-b > .state, .forum .frm-b > .flag, .forum .frm-b > .btns { margin: 12px 14px 0; }
.forum .frm-b > .btns { margin-bottom: 12px; }
.forum .flag { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; border: 1px solid; border-radius: 8px; padding: 7px 10px; min-width: 0; overflow-wrap: anywhere; }
.forum .flag.cau { background: var(--cau-bg); color: var(--cau-t); border-color: var(--cau-b); }
.forum .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); }
.forum .cardf:empty { display: none; }
.forum [data-part="new-thread"] { border-top: 1px solid var(--line); }
.forum [data-part="new-thread"] > .comp { border-top: 0; }

.thr { display: grid; grid-template-columns: minmax(0, 1fr) 132px 148px 112px; grid-template-areas: "id n last dia" "pop pop pop pop"; align-items: center; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.thr:last-child { border-bottom: 0; }
.thr-h { grid-template-areas: "id n last dia"; padding-top: 7px; padding-bottom: 7px; background: var(--head); font-size: 11.5px; font-weight: 600; color: var(--dim); }
.thr-h > * { min-width: 0; }
.thr-id { grid-area: id; align-items: flex-start; }
.thr-n { grid-area: n; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.thr-last { grid-area: last; min-width: 0; }
.thr-dia { grid-area: dia; display: flex; align-items: center; min-width: 0; }
.thr-pop { grid-area: pop; min-width: 0; }
.thr-pop:empty { display: none; }
.thr-title { overflow-wrap: anywhere; }
.thr-title:hover { text-decoration: underline; }
.thr-by { gap: 2px 8px; font-size: 12px; overflow-wrap: anywhere; }
.thr[data-show="collapsed"] .thr-title, .thr[data-show="removed"] .thr-title { color: var(--dim); }

/* the Official tab and an own topic: read by anyone */
.frm-official { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.frm-official > .flag { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--sy-b); border-radius: 8px; background: var(--sy-bg); color: var(--sy-t); padding: 8px 12px; min-width: 0; overflow-wrap: anywhere; }
.frm-slot { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.frm-exec { gap: 4px 10px; min-width: 0; }
.frm-exec .mono { min-width: 0; overflow-wrap: anywhere; }
.frm-own { min-width: 0; }

/* a thread: the post that opens it, and its replies */
.thread { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.thread-top { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.thread-top .thr-heading h1 { overflow-wrap: anywhere; }
.thread-top .thr-heading .row { gap: 4px 8px; }
.thread-top .card > .post { border-bottom: 0; }
.thread-top .card > .card-b .btns { gap: 8px; }

/* a profile: who, then the profile and statements beside the names */
.profile { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pf-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pf-who .two { gap: 4px; }
.pf-tile { display: flex; flex: none; }
.pf-who h1 { overflow-wrap: anywhere; }
.pf-who .row { gap: 4px 10px; }
.pf-addr { min-width: 0; overflow-wrap: anywhere; }
.pf-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.pf-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.pf-rail { flex: 1 1 300px; max-width: 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.pf-rail .mono { min-width: 0; overflow-wrap: anywhere; }
.pf-rows { display: flex; flex-direction: column; }
.pf-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.pf-row:last-child { border-bottom: 0; }
.pf-k { color: var(--dim); font-weight: 500; }
.pf-v { min-width: 0; overflow-wrap: anywhere; gap: 4px; }
.pf-v .sub.warn { color: var(--warn); }
.pf-v .row { gap: 6px; }
.pf-l { justify-self: end; }
.pf-rail .pf-row { grid-template-columns: minmax(0, 1fr) auto; }
.pf-rail .pf-k { grid-column: 1 / -1; }
.pf-rows > .state { margin: 12px 14px; }
.pf-h { font-size: 14px; }
.pf-sts { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pf-sts-b { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pf-st { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pf-st-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-width: 0; overflow-wrap: anywhere; }
.pf-st-h .pf-st-n { flex: 1 1 140px; min-width: 0; gap: 2px; }
.pf-st-h .pf-st-n .row { gap: 4px 6px; }
.pf-st-b { min-width: 0; }
/* a statement that is open is one block: its head row is the top of the discussion below it, which does not name the DAO again */
.pf-st.open { gap: 0; }
.pf-st.open .pf-st-h { border-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.pf-st.open .pf-st-b > .card { border-top-left-radius: 0; border-top-right-radius: 0; }

@media (max-width: 899px) {
  .pf-rail { max-width: none; flex-basis: 100%; }
}

@media (max-width: 599px) {
  .thr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id id" "n last" "dia dia" "pop pop"; gap: 6px 12px; }
  .thr-h { display: none; }
  .thr-last { justify-self: end; text-align: right; }
  .pf-row { grid-template-columns: minmax(0, 1fr); }
  .pf-l { justify-self: start; }
  .pf-who > :first-child { flex: none; }
  .forum .btn, .pf-st-h .btn { min-height: 44px; }
}
