/* Community reading and writing pages share the home masthead, type and paper. */
body { min-height: 100vh; display: flex; flex-direction: column; }
.colophon { margin-top: auto; }
.sections a[aria-current] { color: var(--teal); font-weight: 700; text-decoration: underline; text-underline-offset: .42em; text-decoration-thickness: 2px; }
.journal-body { padding-block: clamp(1.4rem, 4vw, 3.3rem); }
.journal-body :is(input, textarea, button, select) { font: inherit; color: inherit; }
.journal-body :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), textarea, select) {
  max-width: 100%; min-width: 0; width: 100%; min-height: 44px; padding: .55rem .72rem;
  border: 1px solid #81948f; border-radius: 2px; background: #fffefa;
}
.journal-body textarea { resize: vertical; }
.journal-body :is(input, textarea)::placeholder { color: #5a696b; }
.journal-body :is(input, select) { accent-color: var(--teal); }
.btn, .journal-body button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 44px; padding: .5rem 1rem;
  cursor: pointer; text-decoration: none; font-weight: 650; border: 1px solid var(--teal); border-radius: 2px; background: transparent; color: var(--teal);
}
.btn:hover, .journal-body button.btn:hover { background: #e4ece6; }
.btn--accent, .journal-body button.btn--accent { background: var(--teal); color: white; }
.btn--accent:hover, .journal-body button.btn--accent:hover { background: #173e43; color: white; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fine, .muted, .eyebrow, .ranktag, .ranktag--solid { color: var(--muted); }
.fine, .eyebrow, .ranktag, .pill, .stamp { font-size: .875rem; }
.mono { font-variant-numeric: tabular-nums; }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding-bottom: clamp(1.1rem, 3vw, 2rem); border-bottom: 3px double var(--ink); }
.pagehead h1, .herocard h1 { margin: 0; font: 700 clamp(2rem, 4vw, 3.5rem)/1.25 var(--display); letter-spacing: -.065em; }
.herocard h1 { text-wrap: balance; font-family: inherit; letter-spacing: -.045em; }
.lede { margin-top: .55rem; max-width: 48rem; color: #3f5155; }
.backlink { font-size: .9rem; margin-bottom: .6rem; color: var(--teal); }
.backlink a { display: inline-block; padding-block: .4rem; }
.catalog, .two { display: grid; gap: clamp(1.2rem, 4vw, 3.5rem); align-items: start; grid-template-columns: minmax(0, 1fr) minmax(15rem, 29%); }
.catalog { grid-template-areas: "results finder"; margin-top: clamp(1.25rem, 3vw, 2.3rem); }
.results { grid-area: results; }
.finder, .two__side .panel { padding: clamp(1rem, 2vw, 1.45rem); background: #eaf0ea; border-top: 2px solid var(--teal); }
.finder { grid-area: finder; display: grid; gap: .8rem; }
.finder h2, .panel__title { color: var(--teal); }
.field { display: grid; gap: .35rem; }
.field label, .field__label { font-weight: 650; }
.field .muted { font-size: .875rem; font-weight: 400; }
.finder-actions, .form__actions, .commentform__row, .rebuilt-note__row { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; }
.finder-actions a, .empty-state a { color: var(--teal); }
.empty-state { display: flex; align-items: center; gap: 1rem; padding: clamp(1.4rem, 4vw, 3rem) 0; }
.empty-state img { width: clamp(5rem, 13vw, 9rem); height: auto; mix-blend-mode: darken; filter: brightness(1.04); }
.empty-state p { margin-top: .25rem; color: var(--muted); }
.entries :is(.rank-backtester, .rank-paper, .rank-live, .rank-alpha, .rank-market_maker) { padding-inline-start: .85rem; border-inline-start: 1px solid var(--rule); }
.entries :is(.rank-paper, .rank-live) { border-inline-start: 2px solid #81948f; }
.entries :is(.rank-alpha, .rank-market_maker) { border-inline-start: 3px solid var(--teal); }
.directory { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
.directory li { border-bottom: 1px solid var(--rule); }
.directory a { padding: 1rem .25rem; display: flex; align-items: flex-start; gap: 1rem; text-decoration: none; }
.directory a:hover h2 { text-decoration: underline; }
.directory h2 { font-family: inherit; font-size: 1.25rem; }
.directory small { color: var(--muted); }
.avatar { display: grid; place-items: center; flex: none; width: 3rem; height: 3rem; background: #e4ece6; color: var(--teal); font-size: 1.5rem; font-weight: 700; }
.herocard { border-bottom: 3px double var(--ink); padding-block: .5rem 1.25rem; }
.card__top, .byline__tools, .chips, .stamps, .sec__head, .block__head, .profilehead, .profilehead__name, .comment__by {
  display: flex; gap: .5rem .85rem; align-items: baseline; flex-wrap: wrap;
}
.card__top { color: var(--teal); margin-bottom: .6rem; font-weight: 700; }
.byline__tools { align-items: center; }
.linkbtn { min-height: 32px; border: 0; padding: 0 .2rem; background: none; text-decoration: underline; cursor: pointer; }
.praises { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1.15rem; }
.praise { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid #81948f; border-radius: 2px; padding: .45rem .75rem; min-height: 44px; background: transparent; cursor: pointer; }
.praise[aria-pressed="true"] { color: white; background: var(--teal); border-color: var(--teal); }
.praise__n { font-weight: 700; }
.praise:disabled { cursor: wait; }
.rebuilt-note, .claim, .loginline { padding: .9rem 1rem; background: #eaf0ea; }
.rebuilt-note__row { margin-top: .5rem; }
.rebuilt-note__row input { flex: 1 1 12rem; }
.sec, .block { padding-block: 1.25rem; border-top: 1px solid var(--rule); }
.sec h2, .block__head, .sec__head, .panel__title { margin-bottom: .55rem; }
.block__head, .sec__head { justify-content: space-between; }
.block__head a, .sec__head a, .chip, .repo, .comment__by a, .rebuilt a, .loginline a { color: var(--teal); }
.logic, .kv { display: grid; gap: .45rem 1.25rem; grid-template-columns: auto minmax(0, 1fr); margin: .4rem 0 0; }
.logic dd, .kv dd { margin: 0; }
.logic dt, .kv dd { font-weight: 650; }
.logic dd, .prose { white-space: pre-wrap; line-height: 1.8; }
.checks { display: grid; gap: .55rem; }
.checks li { display: flex; gap: .75rem; align-items: baseline; }
.checks__tag { padding: 0 .35rem; flex: none; border: 1px solid var(--rule); font-size: .8125rem; color: var(--muted); }
.checks .on .checks__tag, .stamp { background: #e2ebe4; color: var(--teal); }
.claim, .loginline, .commentform { margin-top: .9rem; }
.claim { font-size: .9rem; }
.claim b { display: block; }
.comment { border-top: 1px solid var(--rule); padding: .8rem .6rem; }
.comment--author { background: #eaf0ea; }
.comment__by { font-size: .9rem; }
.commentform__row { margin-top: .5rem; }
.commentform__row select { flex: 1 1 12rem; }
.two__side { display: grid; gap: 1rem; }
.kv { grid-template-columns: 1fr auto; }
.panel .fine { margin-top: .7rem; }
.profilehead { align-items: center; }
.profilehead__body { flex: 1 1 17rem; min-width: 0; }
.duo { display: grid; gap: clamp(1rem, 4vw, 3rem); grid-template-columns: repeat(2, minmax(0,1fr)); margin-block: 1.5rem; }
.duo > .panel { border-top: 2px solid var(--teal); background: #eaf0ea; padding: 1.2rem; }
.bars { display: grid; gap: .65rem; }
.bar__row { display: flex; align-items: baseline; justify-content: space-between; gap: .7rem; }
.bar__track { height: .35rem; margin-block: .35rem; background: #c1d0c8; }
.bar__fill { height: 100%; background: var(--teal); }
.got { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .5rem .85rem; }
.stamp { display: inline-flex; align-items: baseline; gap: .5rem; padding: .15rem .45rem; }
.badgebox { max-width: 45rem; }
.badgebox img { max-width: 100%; object-fit: contain; }
.badgebox input, .badgebox button { margin-top: .5rem; }
.form, .errors { max-width: 48rem; margin-block: 1.2rem; }
fieldset.panel { margin: 0 0 1.5rem; padding: .85rem 0 0; min-inline-size: 0; border: 0; border-top: 1px solid var(--rule); }
legend { padding: 0 .75rem 0 0; color: var(--teal); font-weight: 700; font-size: 1.2rem; }
.form .field + .field, .form__actions { margin-top: .85rem; }
.seg { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.checkline, .seg label { display: flex; align-items: baseline; gap: .5rem; padding-block: .55rem; cursor: pointer; }
.checkline input, .seg input { flex: none; margin: 0; }
.errors { color: #813623; background: #f7eae3; padding: .9rem 1rem; }
.ladder { list-style: none; margin: 0; padding: 0; }
.rung { display: grid; grid-template-columns: minmax(0,.8fr) repeat(2, minmax(0,1fr)); gap: 1rem; padding-block: 1.25rem; border-bottom: 1px solid var(--rule); }
.rung--me { background: #eaf0ea; }
.plain { list-style: disc; padding-left: 1.3rem; }
.toast { position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 2rem); padding: .6rem 1rem; background: var(--ink); color: var(--paper); opacity: 0; pointer-events: none; }
.toast.on { opacity: 1; }
@media (max-width: 47rem) {
  .catalog, .two, .duo, .directory, .rung { grid-template-columns: minmax(0, 1fr); }
  .catalog { grid-template-areas: "finder" "results"; }
  .finder { grid-template-columns: repeat(2, minmax(0,1fr)); align-items: end; }
  .finder h2, .finder-actions { grid-column: 1 / -1; }
  .finder .field:has(input[type="search"]):not(:has(+ .field)) { grid-column: 1 / -1; }
  .rung { gap: .35rem; }
}
@media (max-width: 30rem) {
  .pagehead { align-items: flex-start; flex-direction: column; }
  .empty-state { align-items: flex-start; }
  .logic { grid-template-columns: minmax(0, 1fr); }
}
