/* page specific styles: rules, team, evaluation, handbook, admin, audit, portal, trust */
.narrow-ish { max-width: 58rem; }
.rules-sec { margin-top: var(--s-5); }
.rules-sec > h2 { margin-bottom: var(--s-3); }
.section { margin-top: var(--s-5); }
.sep { border-top: 1px solid var(--line); }
.strong { font-weight: 700; }
.bad { color: var(--danger-ink); }
td.bad, .num.bad { font-weight: 800; }
.tnum { font-variant-numeric: tabular-nums; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: var(--s-5); }

/* team ledger */
.ledger th { width: 16rem; background: none; font-weight: 600; color: var(--ink); position: static; border-bottom: 1px solid var(--line); }
.ledger td.num { width: 8rem; font-size: var(--t-md); }
.ledger tr.warn td, .ledger tr.warn th { background: var(--warn-bg); }
.stackbar { display: flex; height: 0.9rem; border-radius: 999px; overflow: hidden; background: var(--rail); }
.stackbar span { display: block; height: 100%; }
.seg-new { background: var(--line-strong); }
.seg-ready { background: var(--info-ink); }
.seg-hand { background: #d49a00; }
.seg-done { background: var(--ok-ink); }
.seg-closed { background: var(--pine-300); }
.legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.legend li { display: inline-flex; align-items: center; gap: var(--s-2); }
.swatch { width: 0.8rem; height: 0.8rem; border-radius: 3px; display: inline-block; }
.hbar { display: grid; grid-template-columns: 13rem 1fr 2rem; gap: var(--s-3); align-items: center; }
.hbar .track { height: 0.7rem; background: var(--rail); border-radius: 999px; overflow: hidden; display: block; }
.hbar .fill { display: block; height: 100%; background: var(--pine-600); border-radius: 999px; }
@media (max-width: 40rem) { .hbar { grid-template-columns: 1fr 2rem; } .hbar .track { grid-column: 1 / -1; order: 3; } }

/* evaluation */
.progress { flex: 1; height: 0.6rem; background: var(--rail); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 100%; background: var(--pine-600); border-radius: 999px; transform: scaleX(var(--p, 0)); transform-origin: left center; transition: transform 0.6s var(--ease-out); }
.five th { font-weight: 600; color: var(--ink); background: none; position: static; white-space: normal; }
.five thead th { background: var(--pine-50); color: var(--ink-2); }
.five td.num { font-size: var(--t-md); white-space: nowrap; }
.kv.wide { grid-template-columns: max-content 1fr; gap: var(--s-2) var(--s-5); }
tr.clickable { cursor: pointer; }
tr.clickable:focus-visible { outline-offset: -2px; }
tr.detail > td { background: var(--pine-50); padding: var(--s-4); }
.tickets th, .tickets td { vertical-align: middle; }

/* handbook */
.diffcard { background: var(--surface); }
.diffcard .clause-text { margin-top: var(--s-3); max-width: 70ch; }
.diff { line-height: 1.7; }

/* admin */
.secret { font-family: var(--mono); font-size: var(--t-md); background: #fff; border: 1px dashed var(--gold-500); border-radius: var(--r-sm); padding: 0.3rem 0.6rem; user-select: all; }
.detailcell { max-width: 28rem; overflow-wrap: anywhere; color: var(--ink-3); }
.detailcell code { font-size: var(--t-xs); }

/* portal */
.portal { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s-5); align-items: start; }
@media (max-width: 52rem) { .portal { grid-template-columns: 1fr; } }
.mlist { display: flex; flex-direction: column; }
.mitem { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.mitem:hover { background: var(--pine-50); }
.mlist li:last-child .mitem { border-bottom: 0; }
.msnip { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.foot { margin-top: var(--s-5); }
.tracker { display: flex; justify-content: space-between; position: relative; margin: var(--s-4) var(--s-4) var(--s-5); padding-top: 2.6rem; }
.tracker::before { content: ''; position: absolute; left: 1.2rem; right: 1.2rem; top: 3.05rem; height: 4px; background: var(--pine-100); border-radius: 4px; }
.tracker li { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s-2); width: 7rem; text-align: center; font-size: var(--t-sm); color: var(--ink-3); }
.tracker li .node { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--surface); border: 2px solid var(--pine-300); display: grid; place-items: center; margin-top: 0.15rem; }
.tracker li.done .node { background: var(--pine-600); border-color: var(--pine-600); color: #fff; }
.tracker li.done { color: var(--ink-2); }
.tracker li.now { color: var(--pine-900); font-weight: 700; }
.tracker li.now img { position: absolute; top: -2.6rem; width: 2.6rem; animation: dino-read 1.8s ease-in-out infinite; }
.tracker li.now::before { content: ''; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--pine-800); box-shadow: 0 0 0 4px rgb(75 145 124 / 0.25); margin-top: 0.15rem; order: -1; }
.letter.you { margin-bottom: var(--s-4); }
.letter.reply { border-color: var(--ok-line); background: #fbfefc; margin-bottom: var(--s-4); }
.letter .ai { display: flex; gap: var(--s-1); margin-top: var(--s-3); align-items: center; }

/* trust */
.trust { max-width: 46rem; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s-5); }
.trust.in-app { padding: var(--s-6) var(--s-4) var(--s-8); }
.trust-top { display: flex; justify-content: space-between; align-items: center; }
.trust-top .logo .mark, .trust-top .logo .wordmark { filter: none; }
.trust h1 { font-size: var(--t-2xl); }
.trust h2 { margin-bottom: var(--s-2); }
.trust section { display: flex; flex-direction: column; gap: var(--s-3); }
.trust .table th[scope='row'] { background: none; position: static; font-weight: 650; }
ul.plain li { display: flex; gap: var(--s-3); align-items: flex-start; padding: 0.25rem 0; }
ul.plain .icon { color: var(--pine-600); margin-top: 0.3rem; }
@media (max-width: 40rem) { .tracker li { width: 5.4rem; font-size: var(--t-xs); } }

/* work distribution table on the Team page */
.dist th[scope='row'] { background: none; position: static; font-weight: 500; white-space: nowrap; }
.dist td { vertical-align: middle; }
.dist .select { min-height: 2rem; padding-block: 0.2rem; width: 5.5rem; }
.skills { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.skillchip { appearance: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 0.15rem 0.6rem; font-size: var(--t-xs); font-weight: 600; cursor: pointer; }
.skillchip:hover { border-color: var(--pine-500); color: var(--pine-900); }
.skillchip[aria-pressed='true'] { background: var(--pine-800); border-color: var(--pine-800); color: #fff; }
.loadtrack { display: inline-block; width: 7rem; height: 0.7rem; background: var(--rail); border-radius: 999px; overflow: hidden; vertical-align: middle; }
.loadtrack .fill { display: block; height: 100%; background: var(--pine-600); border-radius: 999px; }
