/* Forms, notices, facts, menus, avatars (PRD section 10). Tokens only. */

.tnum { font-variant-numeric: tabular-nums; }
.btn--block { width: 100%; }
.page__actions { margin-top: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.status-line { font-size: 13px; line-height: 1.4; color: var(--ink-secondary); }

.section { margin-top: 32px; }
.section__title { font-size: 18px; line-height: 1.25; font-weight: 700; margin-bottom: 4px; }
@media (min-width: 768px) { .section__title { font-size: 20px; } }
.section > .secondary { font-size: 13px; line-height: 1.4; }
@media (min-width: 768px) { .section > .secondary { font-size: 14px; } }

/* Notices */
.flashes { display: block; }
.notice--ok, .notice--error, .notice--message { margin: 0; }
.notice--error { color: var(--danger); }
.notice--block { display: block; padding: 16px var(--gutter); }
.notice--block p { font-size: 13px; line-height: 1.5; max-width: 60ch; }
.notice__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 12px; }
.notice__actions form { margin: 0; }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 4px; }
.field__label { font-size: 13px; font-weight: 600; }
.input {
  width: 100%; height: 48px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 0;
  background: var(--bg); color: var(--ink); font: 400 15px/1.3 var(--font);
}
select.input { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.input--area { height: auto; min-height: 112px; padding: 12px; resize: vertical; }
.input:focus { border-color: var(--ink); outline: 2px solid var(--focus); outline-offset: 1px; }
.field--error .input { border-color: var(--danger); }
.field__note { font-size: 12px; line-height: 1.4; color: var(--ink-secondary); }
.field__note--error { color: var(--danger); }

.errsum { border: 1px solid var(--danger); border-radius: 0; padding: 12px 16px; margin: 16px 0; color: var(--danger); }
.errsum ul { margin-top: 4px; }
.errsum:focus { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Checkbox and radio rows */
.checks { border-top: 1px solid var(--rule); }
.check {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px;
  padding: 6px 0; border-bottom: 1px solid var(--rule); cursor: pointer;
}
.check__input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; }
.check__box {
  position: relative; flex: none; width: 22px; height: 22px; border: 1px solid var(--ink);
  border-radius: 2px; background: var(--bg);
}
.check--radio .check__box { border-radius: 50%; }
.check__input:checked + .check__box { background: var(--ink); }
.check__input:checked + .check__box::after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px;
  border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.check--radio .check__input:checked + .check__box::after {
  left: 6px; top: 6px; width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--bg); transform: none;
}
.check__input:focus-visible + .check__box { outline: 2px solid var(--focus); outline-offset: 2px; }
.check__label { font-size: 15px; line-height: 1.3; }
.check__label small { display: block; font-size: 13px; line-height: 1.4; color: var(--ink-secondary); }

/* Facts: ruled label/value rows */
.facts { margin: 16px 0 0; border-top: 1px solid var(--rule); }
.fact { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.fact dt { font-size: 13px; color: var(--ink-secondary); }
.fact dd { margin: 0; text-align: right; font-weight: 600; }
.fact dd small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-secondary); }

/* Avatars: the only circles */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; }
.avatar--28 { width: 28px; height: 28px; }
.avatar--56 { width: 56px; height: 56px; }
.avatar--initial {
  display: inline-flex; align-items: center; justify-content: center; background: var(--strip-off);
  color: var(--ink); font-weight: 700; font-size: 13px;
}
.avatar--56.avatar--initial { font-size: 22px; }
.identity { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; }
.identity__name { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }

/* Avatar menu (details/summary: keyboard operable without JavaScript) */
.menu { position: relative; }
.menu__button {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px;
  padding: 0 4px; cursor: pointer;
  list-style: none; font-size: 14px; font-weight: 500; max-width: 180px;
}
.menu__button::-webkit-details-marker { display: none; }
.menu__button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu__panel {
  position: absolute; right: 0; top: 100%; z-index: 30; min-width: 180px; padding: 4px 0;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 0;
}
.menu__panel a, .menu__item {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 16px; background: none;
  border: 0; font: 400 15px/1 var(--font); color: var(--ink); text-decoration: none; text-align: left; cursor: pointer;
}
.menu__panel a:hover, .menu__item:hover { background: var(--surface-alt); }
.menu__panel form { margin: 0; }

/* Generic ruled rows */
.rows { border-top: 1px solid var(--rule); margin-top: 16px; }
.row { border-bottom: 1px solid var(--rule); }
.row__form { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.row__main { display: flex; flex-direction: column; min-width: 0; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0 8px; margin: 4px 0 0 -8px; }
.site-footer__links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 8px; font-size: 12px; }

/* Long-form text: about, rules, privacy and terms */
.prose { max-width: 60ch; }
.prose p, .prose ul, .prose ol { margin-top: 12px; font-size: 15px; line-height: 1.6; }
.prose ul, .prose ol { padding-left: 20px; }
.prose li + li { margin-top: 6px; }
.prose a { display: inline-block; min-width: 44px; padding: 14px 6px; margin: -14px -6px; text-align: center; text-decoration: underline; }
.prose .section__title { margin-top: 0; }
.prose__updated { font-size: 13px; color: var(--ink-secondary); }
