/* Excodex portal - builds on styles.css tokens (drafting film, Prussian ink, Ex amber). */

body.portal { display: flex; flex-direction: column; min-height: 100svh; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--graphite); }
.small { font-size: .88rem; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ok { color: var(--ok); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.warn { color: var(--amber-deep); font-weight: 600; }
.loading { color: var(--graphite); padding: 40px 0; }
.empty { color: var(--graphite); padding: 14px 0; }
.danger { color: var(--red) !important; }

/* --------------------------------------------------------------- header */
.ptop {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--film) 90%, transparent);
  backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}
.ptop-row { display: flex; align-items: center; gap: 18px; padding: 10px var(--edge); }
.pnav { display: flex; gap: 2px; margin-inline-start: 12px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.pnav::-webkit-scrollbar { display: none; }
.pnav a {
  white-space: nowrap; text-decoration: none; color: var(--ink-2);
  padding: 8px 11px; border-radius: 6px; font-weight: 600; font-size: .96rem;
}
.pnav a:hover { background: var(--film-deep); color: var(--ink); }
.pnav a[aria-current="true"] { color: var(--ink); box-shadow: inset 0 -2.5px 0 var(--amber); border-radius: 0; }
.ptools { display: flex; align-items: center; gap: 12px; margin-inline-start: auto; }
.guest-tools, .member-tools { display: inline-flex; align-items: center; gap: 12px; }
.icon-link { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink); }
.icon-link:hover { background: var(--film-deep); }
.icon-link svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linejoin: round; }
.badge {
  position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-grid; place-items: center; border-radius: 999px;
  background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1;
}
.badge.inline { position: static; margin-inline-start: auto; }
.acct { position: relative; }
.acct-btn { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; }
.acct-menu {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 200px; z-index: 40;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; padding: 6px;
  box-shadow: 0 20px 40px -20px rgba(20, 35, 59, .45); display: grid;
}
.acct-menu a, .acct-menu button {
  display: block; text-align: start; width: 100%; padding: 9px 12px; border-radius: 6px; border: 0; background: none;
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; cursor: pointer;
}
.acct-menu a:hover, .acct-menu button:hover { background: var(--film); }

/* ------------------------------------------------------------- avatars */
.avatar {
  --a-bg: var(--ink); --a-fg: var(--film);
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--a-bg); color: var(--a-fg);
  font-family: "Sofia Sans Condensed", sans-serif; font-weight: 800; font-size: .9rem; letter-spacing: .02em;
}
.avatar[data-tone="1"] { --a-bg: #2F5D62; }
.avatar[data-tone="2"] { --a-bg: #8F5C00; }
.avatar[data-tone="3"] { --a-bg: #5B3F6E; }
.avatar[data-tone="4"] { --a-bg: #3B4A5B; }
.avatar[data-tone="5"] { --a-bg: #7A2E2A; }
.avatar.sm { width: 26px; height: 26px; font-size: .7rem; }
.avatar.md { width: 46px; height: 46px; font-size: 1.05rem; }
.avatar.lg { width: 88px; height: 88px; font-size: 2rem; }
.person { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 600; min-width: 0; }
a.person:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------- layout */
.pbanner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 10px var(--edge); background: #F3E3BE; color: #4A3300; font-size: .95rem; border-bottom: 1px solid #E2C98B;
}
.pmain { flex: 1; outline: none; }
.pwrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(28px, 5vw, 56px) var(--gutter) clamp(48px, 7vw, 88px); }
.pwrap.narrow { max-width: calc(860px + 2 * var(--gutter)); }
.form > .btn, .form > button.btn { justify-self: start; }
.wmeta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .85rem; color: var(--graphite); }
.phead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: clamp(20px, 3vw, 32px); }
.phead h1, .pwrap > h1 { font-weight: 800; font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: -.01em; }
.phead-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.lead-s { margin-top: 8px; color: var(--ink-2); font-size: 1.08rem; max-width: 62ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .92rem; margin-bottom: 14px; }
.crumbs a { color: var(--ink-2); }
.sec { font-family: var(--f-cond); font-weight: 800; font-size: 1.4rem; margin: 34px 0 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.sec .muted { font-family: var(--f-body); font-weight: 400; font-size: .95rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.eyebrow-num { color: var(--graphite); font-weight: 600; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-ghost:hover { background: var(--film-deep); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #8E231E; }
.form-ok { color: var(--ok); font-weight: 600; }
.form-ok:empty { display: none; }

/* inputs without explicit type and textareas */
.field input:not([type]), .field textarea, .filters input, .filters select, .inline-field input {
  width: 100%; min-height: 46px; background: var(--sheet); border: 1.5px solid var(--field-line); border-radius: var(--radius);
  padding: 10px 13px; font-size: 1rem; line-height: 1.4; color: var(--ink); font-family: inherit;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:not([type]):focus, .field textarea:focus, .filters input:focus, .filters select:focus, .inline-field input:focus, .composer textarea:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(227, 155, 11, .5);
}
.filters select { appearance: none; -webkit-appearance: none; padding-inline-end: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 13px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
[dir="rtl"] .filters select { background-position: 13px 52%, 19px 52%; }
.row-2.tight { max-width: 360px; grid-template-columns: 1fr; }
.chips.small .chip span { min-height: 34px; padding: 5px 11px; font-size: .88rem; }
.chip input[type="radio"] + span { cursor: pointer; }
.chip input:checked + span { background: var(--ink); color: var(--film); border-color: var(--ink); }

/* ---------------------------------------------------------------- home */
.joinstrip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 16px 20px; margin-bottom: 26px; background: var(--ink); color: var(--film); border-radius: 10px; }
.joinstrip p { max-width: 70ch; }
.joinstrip .btn { background: var(--amber); color: var(--ink); }
.custom-panel { border: 1.5px dashed var(--field-line); border-radius: 10px; padding: 14px 18px; margin-bottom: 22px; display: grid; gap: 10px; background: var(--sheet); }
.inline-field { display: grid; gap: 6px; font-weight: 600; max-width: 560px; }
.widgets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(22px, 3vw, 36px) clamp(24px, 4vw, 56px); align-items: start; }
.widget { border-top: 2px solid var(--ink); padding-top: 12px; min-width: 0; }
.widget.is-off { opacity: .55; border-top-style: dashed; }
.wh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.wh h2 { font-weight: 800; font-size: 1.35rem; }
.wtools { display: inline-flex; align-items: center; gap: 4px; }
.wtools .icon-btn svg { width: 20px; height: 20px; }
.wsub { font-family: var(--f-body); font-size: .85rem; font-weight: 700; color: var(--graphite); margin: 12px 0 2px; }
.wlist { list-style: none; margin: 0; padding: 0; }
.wlist li { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.wlist li a:not(.person) { color: var(--ink); font-weight: 600; text-decoration: none; line-height: 1.35; }
.wlist li a:not(.person):hover { text-decoration: underline; text-underline-offset: 3px; }
.wlist li .muted { font-size: .85rem; }
.wlist.ranked { counter-reset: r; }
.wlist.ranked li { grid-template-columns: 2ch 1fr; column-gap: 10px; counter-increment: r; }
.wlist.ranked li::before { content: counter(r); grid-row: span 2; font-family: "Sofia Sans Extra Condensed", sans-serif; font-weight: 800; font-size: 1.6rem; line-height: 1; color: var(--amber-deep); }
.wlist.people li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wlist.people li .muted { flex: 1; }
.wlist.book-mini li { display: flex; justify-content: space-between; gap: 12px; }
.row-actions { display: inline-flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.wfoot { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .92rem; }
.vlist { list-style: none; padding: 0; margin: 0; }
.vlist li { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.vlist li .ok { grid-column: span 2; }
.meter { display: block; height: 7px; background: var(--film-deep); border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--rule); }
.meter span { display: block; height: 100%; background: var(--amber); }
.vmark { width: 16px; height: 16px; flex: none; }
.vmark circle { fill: var(--ok); }
.vmark path { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------- lists & tags */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.filters select, .filters input[type="search"] { width: auto; min-width: 160px; flex: 0 1 220px; }
.filters input[type="search"] { flex: 1 1 220px; }
.filters .cc { flex: 0 0 110px; min-width: 0; text-transform: uppercase; }
.seg { display: inline-flex; border: 1.5px solid var(--field-line); border-radius: 999px; padding: 3px; background: var(--sheet); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--film); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--ink); }
.tlist, .rlist { list-style: none; margin: 0; padding: 0; }
.titem, .tlist > li, .rlist > li { display: grid; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.titem { grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: baseline; }
.titem .tmeta { grid-column: 2; }
.ttitle, .rtitle { color: var(--ink); font-family: var(--f-cond); font-weight: 700; font-size: 1.22rem; line-height: 1.25; text-decoration: none; }
.ttitle:hover, .rtitle:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.tmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: .88rem; color: var(--ink-2); }
.tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; background: var(--film-deep); color: var(--ink-2); font-size: .8rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
a.tag:hover { background: var(--rule); }
.kind { display: inline-block; font-size: .74rem; font-weight: 800; padding: 3px 8px; border-radius: 4px; background: var(--film-deep); color: var(--ink-2); white-space: nowrap; }
.kind-question { background: #E9DDF5; color: #4B2E66; }
.kind-agenda { background: #F3E3BE; color: #5C3D00; }
.answered { color: var(--ok); font-weight: 700; }
.more { margin-top: 18px; }
.chips-inline { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; }
.fchip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--rule); font-size: .76rem; color: var(--ink-2); }
.fchip.is-v { border-color: var(--ok); color: var(--ok); font-weight: 700; }
.fchip .vmark { width: 12px; height: 12px; }

/* ---------------------------------------------------- reading blocks */
.md { line-height: 1.65; overflow-wrap: anywhere; }
.md p + p, .md ul, .md ol, .md h4 { margin-top: .8em; }
.md ul, .md ol { padding-inline-start: 1.3em; }
.md h4 { font-family: var(--f-cond); font-size: 1.15rem; }
.md code { background: var(--film-deep); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.md a { color: var(--ink); text-underline-offset: 3px; }
.is-translating { cursor: progress; }
.tr-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 8px; font-size: .8rem; color: var(--graphite); }
.tr-note .text-btn { font-size: .8rem; }
.tr-orig { max-height: 160px; overflow: auto; padding: 10px 12px; background: var(--film); border-radius: 6px; font-size: .92rem; white-space: pre-wrap; }

.topic h1, .article h1 { margin: 10px 0 10px; font-weight: 800; font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.12; }
.topic > .md, .article > .md { margin-top: 18px; font-size: 1.08rem; }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 12px; }
.vote {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1.5px solid var(--field-line); background: var(--sheet); border-radius: 999px; padding: 5px 12px 5px 8px;
  font-weight: 700; font-size: .88rem; color: var(--ink-2);
}
.vote svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.vote.is-on { background: var(--ink); color: var(--film); border-color: var(--ink); }
.vote[disabled] { cursor: default; opacity: .75; }
.posts { list-style: none; padding: 0; margin: 0; }
.post { padding: 18px 0; border-top: 1px solid var(--rule); }
.post.is-answer { border-inline-start: 4px solid var(--ok); padding-inline-start: 16px; background: linear-gradient(90deg, rgba(30, 106, 78, .06), transparent 60%); }
[dir="rtl"] .post.is-answer { background: linear-gradient(270deg, rgba(30, 106, 78, .06), transparent 60%); }
.post-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 8px; font-size: .9rem; }
.reply { margin-top: 26px; padding-top: 20px; border-top: 2px solid var(--ink); }
.gate-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 26px; padding: 18px; background: var(--sheet); border-radius: 10px; }
.gate h1 { margin-bottom: 10px; }

/* agenda */
.agenda-list { list-style: none; padding: 0; margin: 0; counter-reset: ag; }
.agenda-list > li { counter-increment: ag; display: grid; grid-template-columns: 2.6ch minmax(0, 1fr); column-gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.agenda-list > li::before { content: counter(ag); grid-row: span 3; font-family: "Sofia Sans Extra Condensed", sans-serif; font-weight: 800; font-size: 2.6rem; line-height: .9; color: transparent; -webkit-text-stroke: 1.3px var(--ink); }
.agenda-list h3 { font-weight: 800; font-size: 1.3rem; }
.agenda-list h3 a { color: var(--ink); text-decoration: none; }
.agenda-list h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.agenda-list .md { margin-top: 6px; color: var(--ink-2); }
.agenda-list .tmeta { margin-top: 8px; }
.proposals { list-style: none; padding: 0; margin: 0; }
.proposals > li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.proposals .vote { flex-direction: column; border-radius: 10px; padding: 6px 10px; gap: 0; min-width: 52px; }
.proposals .vote span { font-size: 1rem; }
.ptitle { font-weight: 700; }
.proposals .md { font-size: .95rem; color: var(--ink-2); margin-top: 4px; }

/* standards */
.std-list { list-style: none; padding: 0; margin: 0; }
.std-list li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.std-list a { display: grid; gap: 2px; text-decoration: none; color: var(--ink); flex: 1 1 420px; min-width: 0; }
.std-code { font-family: "Sofia Sans Extra Condensed", sans-serif; font-weight: 800; font-size: 1.45rem; line-height: 1.05; }
.std-title { color: var(--ink-2); font-size: .95rem; }
.std-list a:hover .std-code { text-decoration: underline; text-underline-offset: 4px; }

/* radar */
.rlist .tmeta .text-btn { font-size: .85rem; }

/* book */
.status { display: inline-block; font-size: .78rem; font-weight: 800; padding: 3px 9px; border-radius: 4px; background: var(--film-deep); }
.status-published { background: #D5EADF; color: #124532; }
.status-review { background: #F3E3BE; color: #5C3D00; }
.status-rejected { background: #F2D6D4; color: #6B1C17; }
.review-box { margin-top: 34px; padding-top: 6px; border-top: 2px solid var(--ink); }
.reviews { list-style: none; padding: 0; margin: 12px 0; }
.reviews li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.reviews li p { flex-basis: 100%; color: var(--ink-2); }
.decision { font-weight: 800; font-size: .8rem; padding: 2px 8px; border-radius: 4px; }
.d-approve { background: #D5EADF; color: #124532; }
.d-reject { background: #F2D6D4; color: #6B1C17; }

/* members */
.mgrid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px 22px; }
.mcard { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.mtext { display: grid; gap: 3px; min-width: 0; }
.mname { font-weight: 700; }
.mcard:hover .mname { text-decoration: underline; text-underline-offset: 3px; }

/* profile */
.prof-head { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; padding-bottom: 22px; border-bottom: 2px solid var(--ink); }
.prof-id { display: grid; gap: 8px; min-width: 0; flex: 1; }
.prof-id h1 { font-weight: 800; font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height: 1.05; }
.rel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 6px; }
.vfields { list-style: none; padding: 0; margin: 0; }
.vfields li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.vf-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.vouchers { flex-basis: 100%; font-size: .85rem; color: var(--ink-2); }
.vfields .btn { margin-inline-start: auto; }
.kv { margin: 0; display: grid; gap: 10px; }
.kv div { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 12px; }
.kv dt { color: var(--graphite); font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* messages */
.msgs { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 0; padding-top: 18px; min-height: calc(100svh - 160px); }
.mside { border-inline-end: 1px solid var(--rule); padding-inline-end: 18px; min-width: 0; }
.mside .sec:first-child { margin-top: 0; }
.clist { list-style: none; padding: 0; margin: 0; }
.clist li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; }
.contact { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); min-width: 0; }
.contact:hover { background: var(--film-deep); }
.contact.is-on { background: var(--sheet); box-shadow: inset 3px 0 0 var(--amber); }
[dir="rtl"] .contact.is-on { box-shadow: inset -3px 0 0 var(--amber); }
.ctext { display: grid; min-width: 0; flex: 1; }
.cname { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.ctext .muted { font-size: .84rem; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-inline-end: 4px; }
.mconv { display: flex; flex-direction: column; min-width: 0; padding-inline-start: 22px; }
.mempty { margin: auto; text-align: center; display: grid; gap: 10px; color: var(--graphite); padding: 40px 0; }
.mhead { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.mhead .back { display: none; }
.bubbles { list-style: none; margin: 0; padding: 16px 4px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex: 1; max-height: calc(100svh - 330px); min-height: 260px; }
.bubble { max-width: min(78%, 560px); align-self: flex-start; background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; border-end-start-radius: 4px; padding: 9px 13px; }
.bubble.mine { align-self: flex-end; background: var(--ink); color: var(--film); border-color: var(--ink); border-end-start-radius: 14px; border-end-end-radius: 4px; }
.bubble.mine .md a { color: var(--film); }
.bubble time { display: block; font-size: .72rem; margin-top: 3px; }
.bubble.mine time { color: #AEB9C7; }
.composer { display: flex; gap: 10px; align-items: flex-end; padding-top: 12px; border-top: 1px solid var(--rule); }
.composer textarea { flex: 1; min-height: 48px; max-height: 180px; resize: vertical; background: var(--sheet); border: 1.5px solid var(--field-line); border-radius: 10px; padding: 11px 13px; font: inherit; color: var(--ink); }

/* settings */
.settings .setblock { margin-top: 34px; padding-top: 4px; border-top: 1px solid var(--rule); display: grid; gap: 10px; }
.danger-zone .sec { color: var(--red); }

/* toast */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: var(--film); padding: 12px 18px; border-radius: 10px; font-weight: 600;
  box-shadow: 0 18px 40px -16px rgba(20, 35, 59, .6); max-width: calc(100vw - 32px);
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .ptop-row { flex-wrap: wrap; row-gap: 4px; }
  .pnav { order: 3; flex-basis: 100%; margin-inline-start: -6px; }
}
@media (max-width: 900px) {
  .widgets, .two-col { grid-template-columns: 1fr; }
  .msgs { grid-template-columns: 1fr; }
  .msgs .mside { border: 0; padding: 0; }
  .msgs.has-conv .mside { display: none; }
  .msgs:not(.has-conv) .mconv { display: none; }
  .mconv { padding-inline-start: 0; }
  .mhead .back { display: inline; }
}
@media (max-width: 640px) {
  .ptop-row { padding-block: 8px; gap: 10px; }
  .ptools { gap: 6px; }
  .guest-tools .btn { display: none; }
  .lang-btn span { max-width: 7ch; }
  .titem { grid-template-columns: 1fr; }
  .titem .tmeta { grid-column: 1; }
  .vlist li { grid-template-columns: 1fr auto; }
  .vlist li .meter { grid-column: 1 / -1; grid-row: 2; }
  .filters select, .filters input[type="search"] { flex: 1 1 100%; }
  .bubble { max-width: 88%; }
  .bubbles { max-height: calc(100svh - 300px); }
}
.person.sys { font-family: "Sofia Sans Extra Condensed", sans-serif; font-weight: 800; font-size: 1.05rem; }
.person.sys .brand-mark { width: 18px; height: 18px; fill: var(--ink); }

/* ===================================================== R02: standing, trust, articles */
.status-checking { background: #E1E6EE; color: #22324C; }
.status-expired, .status-withdrawn { background: var(--film-deep); color: var(--graphite); }
.status-plagiarism { background: #F2D6D4; color: #6B1C17; }
.warn-t { color: var(--red); font-weight: 600; }
.ok.big { font-size: 1.15rem; }

.lvl { display: inline-block; font-size: .74rem; font-weight: 800; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; background: var(--film-deep); color: var(--ink-2); white-space: nowrap; }
.lvl-2 { background: #E4ECDF; color: #24452F; }
.lvl-3 { background: #DCE8EE; color: #183D52; }
.lvl-4 { background: #F3E3BE; color: #5C3D00; }
.lvl-5 { background: #F0D3B8; color: #5A2A04; }
.lvl-6 { background: var(--ink); color: var(--film); }
.badge-chip { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 4px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); }
.standing-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; }
.pts-inline { font-weight: 700; white-space: nowrap; }
.mstate { display: block; margin-top: 6px; }

.standing { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); }
.st-act { display: grid; gap: 6px; min-width: 0; }
.st-label { font-weight: 700; margin: 0; }
.st-pts { display: grid; justify-items: end; gap: 2px; text-align: end; }
.pts { font-family: "Sofia Sans Extra Condensed", sans-serif; font-weight: 800; font-size: 2.2rem; line-height: 1; color: var(--ink); }
.pts-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.pts-big .pts { font-size: 3rem; }

.card-block { background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; padding: 6px 20px 20px; margin-bottom: 20px; }
.card-block .invite { display: flex; flex-wrap: wrap; gap: 8px; }
.card-block .invite input { flex: 1 1 240px; min-height: 40px; padding: 6px 10px; border: 1.5px solid var(--rule); border-radius: 6px; background: var(--film); font: inherit; }
.badges { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.badges li { display: grid; gap: 2px; }
.ledger { list-style: none; padding: 0; margin: 0; }
.ledger li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--rule); font-size: .93rem; }
.ledger li > span:nth-child(2) { font-weight: 800; text-align: end; }
details.how { margin-top: 14px; }
details.how summary { cursor: pointer; font-weight: 700; }

.founding { display: grid; gap: 8px; padding: 14px 18px; margin: 0 0 22px; background: var(--sheet); border-inline-start: 4px solid var(--amber); border-radius: 8px; }
.founding p { margin: 0; }

.art-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.refno { font-size: .8rem; font-weight: 700; color: var(--graphite); letter-spacing: .04em; }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 18px 0; padding: 16px 18px; border-radius: 10px; background: #E1E6EE; color: var(--ink); }
.notice p { margin: 0; font-weight: 600; flex: 1 1 260px; }
.notice.is-stop { background: #F2D6D4; color: #5B1813; }
.abstract { margin: 20px 0 24px; padding: 16px 20px; background: var(--sheet); border-inline-start: 4px solid var(--ink); border-radius: 8px; }
.abstract h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 8px; color: var(--graphite); }
.abstract .md p { margin: 0 0 8px; }
.cite-box { margin-top: 34px; padding-top: 4px; border-top: 1px solid var(--rule); }
.cite { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 12px 14px; overflow-wrap: anywhere; }
.rights { font-size: .9rem; color: var(--ink-2); }
.seal { margin: 22px 0; padding: 16px 20px; border: 1.5px solid var(--ok); border-radius: 10px; background: color-mix(in srgb, var(--ok) 6%, var(--sheet)); }
.seal h2 { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; margin: 0 0 8px; color: var(--ok); }
.seal ul { margin: 0 0 8px; padding-inline-start: 20px; }
.seal li { margin: 4px 0; }
.copies { margin-top: 24px; }

.leaders { list-style: none; padding: 0; margin: 10px 0 0; }
.leaders li { display: grid; grid-template-columns: 34px minmax(0, auto) minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.leaders .rank { font-family: "Sofia Sans Extra Condensed", sans-serif; font-weight: 800; font-size: 1.4rem; color: var(--graphite); text-align: center; }
.leaders li:nth-child(-n+3) .rank { color: var(--amber-deep); }
.reports li { display: grid; gap: 6px; }
.srcs { margin: 2px 0 0; padding-inline-start: 18px; font-size: .9rem; overflow-wrap: anywhere; }
.rules .articles { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr; gap: 18px; }
.rules .articles h2 { font-size: 1.1rem; margin: 2px 0 6px; }
.rules .art-no { margin: 0; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-deep); }

@media (max-width: 720px) {
  .leaders li { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .leaders li > .ellipsis { display: none; }
  .leaders li > .lvl { display: none; }
  .standing { grid-template-columns: 1fr; }
  .st-pts { justify-items: start; text-align: start; }
}

@media print {
  .ptop, .pbanner, .foot, .crumbs, .post-actions, .review-box, .copies, .tr-note, #copyCite, .toast { display: none !important; }
  body.portal { background: #fff; }
  .article { max-width: none; }
  .seal, .abstract, .cite { break-inside: avoid; }
}
.rules-ok { margin-top: 26px; }
.rules .articles h2 { font-size: 1.25rem; }
