/*
 * ES components (wave 10): the shared UI kit of the admin and the "Moderna" forum theme. Needs tokens.css first.
 * Guide with anatomy, states and do/don't: docs/design/README.md. Live: /stil/.
 *
 * The rules up to "forum additions" are the admin's (moved here verbatim from www/admin/assets/admin.css), so the admin
 * and the forum cannot drift. Change them only with a look at both (/admin/ and /stil/). New components go below.
 */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  font-feature-settings: "tnum" 1;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 14px; font-weight: 650; }
code, pre, kbd { font-family: var(--mono); font-size: 12.5px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
.sprite { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.wrap { word-break: break-word; }
.pre { white-space: pre-wrap; word-break: break-word; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }

/* ---- avatar ---- */
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; text-transform: uppercase;
}
.avatar-lg { width: 56px; height: 56px; border-radius: var(--radius); font-size: 13px; text-transform: none; }

/* ---- page head ---- */
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 4px !important; }
.crumbs a { color: var(--muted); }
.lead { font-size: 15px; color: var(--text-2); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---- cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; min-height: 24px; }
.card-head.sub { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.card > form + form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.link { font-size: 13px; font-weight: 500; }
.empty { margin: 4px 0; }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 18px; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 18px; }

/* ---- stats ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; color: var(--text);
  transition: border-color .15s, transform .15s;
}
a.stat:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-1px); }
.stat-label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.stat-note { color: var(--muted); font-size: 12px; }
.stat-alert { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.stat-alert .stat-value { color: var(--accent); }

/* ---- lists ---- */
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.kv li:last-child { border-bottom: 0; }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dl { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; margin: 0; }
.dl dt, .dl dd { padding: 7px 0; border-bottom: 1px solid var(--border); margin: 0; }
.dl dt { color: var(--muted); padding-right: 12px; }
.dl dd { min-width: 0; word-break: break-word; }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: 0; }
.details { margin: 0 0 18px; padding-left: 20px; color: var(--text-2); }
.details li { margin: 4px 0; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table thead th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom-color: var(--border-strong); white-space: nowrap; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table.compact th, .table.compact td { padding: 7px 8px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .email { color: var(--text-2); word-break: break-all; }
.sort { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.sort::after { content: ""; width: 0; height: 0; border: 4px solid transparent; opacity: .35; border-top-color: currentColor; margin-top: 4px; }
.sort.sorted-asc::after { border-top-color: transparent; border-bottom-color: currentColor; margin-top: -4px; opacity: 1; }
.sort.sorted-desc::after { opacity: 1; }
.sort:hover { color: var(--text); text-decoration: none; }
.diff tr.changed td { background: color-mix(in srgb, var(--warn-soft) 60%, transparent); }
.diff th { width: 22%; }
.val { font-size: 12.5px; max-height: 280px; overflow: auto; }
.signature { background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-sm); }

/* ---- badges ---- */
.badge, .tag, .level {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 20px;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.tag { background: var(--info-soft); color: var(--info); font-family: var(--mono); font-weight: 500; border-radius: var(--radius-xs); }
a.tag:hover { text-decoration: none; filter: brightness(.95); }
.tag-lg { font-size: 16px; padding: 3px 10px; }
.level { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.level-1 { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.level-2, .level-3 { background: var(--info-soft); color: var(--info); border-color: transparent; }
.level-4 { background: var(--ok-soft); color: var(--ok); border-color: transparent; }

/* ---- forms ---- */
input[type=text], input[type=search], input[type=email], input[type=number], input[type=password], input[type=url], input[type=tel], select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 7px 10px; min-height: 36px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 22%, transparent); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 550; color: var(--text-2); }
.field .hint { color: var(--muted); font-size: 12px; }
.field-error { color: var(--danger); font-size: 12px; min-height: 0; }
.field-error:empty { display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input, .radios input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.radios { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.radios label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.stack { display: grid; gap: 12px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.field-check { align-self: end; min-height: 36px; }
.form-actions { display: flex; gap: 10px; padding-top: 4px; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; }
.filters .field { flex: 1 1 160px; }
.filters .field.grow { flex: 3 1 260px; }
.filter-actions { display: flex; gap: 8px; }
.quick-filter input { min-height: 32px; padding: 4px 10px; width: 220px; }
form.inline { display: inline; margin: 0; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 550; line-height: 1;
  min-height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 55%, transparent); color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-light { background: rgba(255, 255, 255, .95); color: #7c2d12; border-color: transparent; }
.btn-light:hover { background: #fff; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.danger-zone form + form, .danger-zone form + a, .danger-zone a + form { margin-top: 10px !important; padding-top: 0 !important; border-top: 0 !important; display: block; }
.danger-zone > a.btn { margin-top: 10px; }

/* ---- flash ---- */
.flash {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px;
  border: 1px solid transparent; font-weight: 500;
  animation: flash-in .25s ease-out;
}
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } }
.flash-success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.flash-warning { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.flash-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.flash-close { display: inline-grid; place-items: center; min-width: 36px; min-height: 36px; margin: -9px -8px -9px 0; background: none; border: 0; color: inherit; cursor: pointer; padding: 2px; opacity: .7; }
.flash-close svg { width: 16px; height: 16px; display: block; }
.flash-close:hover { opacity: 1; }

/* ---- paging ---- */
.paging { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pages { display: flex; gap: 4px; flex-wrap: wrap; }
.page { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 6px; border-radius: var(--radius-sm); color: var(--text-2); }
.page:hover { background: var(--surface-2); text-decoration: none; }
.page.current { background: var(--accent); color: #fff; font-weight: 600; }
.gap { padding: 0 4px; color: var(--muted); align-self: center; }

/* ---- empty state / confirm ---- */
.empty-state { max-width: 560px; margin: 48px auto; text-align: center; }
.empty-state h1 { margin-bottom: 8px; }
.empty-state p { color: var(--text-2); }
.empty-code { font-size: 64px; font-weight: 800; letter-spacing: -.04em; color: var(--border-strong); line-height: 1; margin-bottom: 12px; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.confirm-card { max-width: 640px; margin: 24px auto; padding: 26px 28px; }
.confirm-card h1 { margin-bottom: 10px; }
.confirm-card.danger { border-top: 4px solid var(--danger); }
.confirm-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- dialog (admin.js, modern.js) ---- */
dialog.confirm-dialog {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0; width: min(460px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.confirm-dialog::backdrop { background: rgba(10, 12, 16, .55); backdrop-filter: blur(2px); }
.confirm-dialog .dlg-body { padding: 22px 22px 8px; }
.confirm-dialog h2 { font-size: 17px; margin-bottom: 8px; }
.confirm-dialog p { margin: 0; color: var(--text-2); }
.confirm-dialog .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }
.confirm-dialog.danger { border-top: 4px solid var(--danger); }

/* ---- responsive (admin breakpoints) ---- */
@media (max-width: 860px) {
  .dl { grid-template-columns: 1fr; }
  .dl dt { border-bottom: 0; padding-bottom: 0; font-size: 12px; }
}
@media (max-width: 520px) {
  .row-2 { grid-template-columns: 1fr; }
  .stat-value { font-size: 26px; }
  .table-wrap { margin: 0 -14px; padding: 0 14px; }
  .card { padding: 16px 14px; }
}

/* =====================================================================================================================
 * Forum additions (wave 10). Used by the modern theme; available to the admin too.
 * ================================================================================================================== */

/* ---- icons: <svg class="icon"><use href="/assets/modern/sprite.svg#i-name"/></svg> ---- */
.icon { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.icon-sm { width: 14px; height: 14px; vertical-align: -2px; }

/* ---- more buttons ---- */
.btn-lg { min-height: 42px; padding: 0 18px; font-size: var(--fs-md); }
.btn-square { width: var(--control-h); padding: 0; }
.btn-square.btn-sm { width: var(--control-h-sm); }
.btn .icon { width: 16px; height: 16px; vertical-align: 0; }
.btn-group { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---- segmented control: a row of mutually exclusive links (filters, views) ---- */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.segmented a, .segmented button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 0;
  border-radius: calc(var(--radius-sm) - 3px); background: transparent; color: var(--text-2); font: inherit; font-size: var(--fs-sm);
  font-weight: 550; cursor: pointer; white-space: nowrap;
}
.segmented a:hover, .segmented button:hover { color: var(--text); text-decoration: none; }
.segmented [aria-current], .segmented [aria-pressed="true"], .segmented [aria-selected="true"] {
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}

/* ---- tabs: links or buttons over panels (modern.js makes [data-tabs] interactive; without JS all panels show) ---- */
.tabbar { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 12px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabbar a, .tabbar button {
  position: relative; padding: 8px 12px; border: 0; background: none; color: var(--text-2); font: inherit;
  font-size: var(--fs-sm); font-weight: 550; cursor: pointer; white-space: nowrap;
}
.tabbar a:hover, .tabbar button:hover { color: var(--text); text-decoration: none; }
.tabbar [aria-current], .tabbar [aria-selected="true"] { color: var(--text); }
.tabbar [aria-current]::after, .tabbar [aria-selected="true"]::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; border-radius: 2px; background: var(--accent);
}
.tab-panel + .tab-panel { margin-top: 16px; }
.js [data-tabs] .tab-panel + .tab-panel { margin-top: 0; }

/* ---- pills: small link pills (subforums, category jump) ---- */
.pills { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: var(--fs-sm); font-weight: 500;
}
a.pill:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.pill-count { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- badges: more tones ---- */
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge .icon { width: 12px; height: 12px; vertical-align: 0; }
.count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; line-height: 1;
}

/* ---- avatar sizes (letter avatar; the letter comes from |initial) ---- */
.avatar-sm { width: 24px; height: 24px; font-size: 11px; }
.avatar-md { width: 40px; height: 40px; font-size: 15px; }

/* ---- breadcrumbs: <nav class="breadcrumbs"><ol><li><a>...</a></li>...</ol></nav> ---- */
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; list-style: none; margin: 0 0 6px; padding: 0; font-size: var(--fs-sm); color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 4px; color: var(--border-strong); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs [aria-current] { color: var(--text-2); }

/* ---- dropdown: <details class="dropdown"><summary>...</summary><div class="dropdown-list">...</div></details> ---- */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 220px; padding: 6px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.dropdown-list.left { right: auto; left: 0; }
.dropdown-list a, .dropdown-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.dropdown-list a:hover, .dropdown-list button:hover, .dropdown-list a:focus-visible, .dropdown-list button:focus-visible { background: var(--surface-2); text-decoration: none; }
.dropdown-list .icon { color: var(--muted); }
.dropdown-list hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.dropdown-list form { margin: 0; }
.dropdown-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-head strong { display: block; }
.dropdown-label { padding: 6px 10px 2px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }

/* ---- section heading inside the page (h2 + optional action) ---- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.section-head h2 { font-size: var(--fs-md); }

/* ---- skip link ---- */
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.skip:focus { top: 8px; }

/* =====================================================================================================================
 * W41: shared components promoted from page stylesheets (lists.css, account.css). Class names unchanged.
 * ================================================================================================================== */

/* ---- file input: a dashed drop-style box with a button-like picker ---- */
input[type=file] {
  font: inherit; color: var(--text-2); width: 100%; padding: var(--space-3); background: var(--surface-2);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); cursor: pointer;
}
input[type=file]::file-selector-button {
  font: inherit; font-weight: 550; margin-right: var(--space-3); padding: 6px 12px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}

/* ---- chips: toggle chips; <label class="chip"><input type="checkbox|radio"><span>Text</span></label> in .chips ---- */
.chip-group { display: grid; gap: 5px; }
.chip-label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: var(--control-h); padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--surface);
  color: var(--text-2); font-weight: 500; cursor: pointer; transition: background var(--dur-fast), border-color var(--dur-fast);
}
.chip:hover span { background: var(--surface-2); }
.chip input:checked + span { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 650; }
.chip input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }

/* ---- people grid: cards of people (team, moderators); .person > photo/avatar + .person-body ---- */
.people-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
.people-grid-lg { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.person { margin: 0; padding: var(--space-4); display: flex; gap: var(--space-4); align-items: flex-start; }
.person-photo { flex: none; width: 72px; height: 72px; border-radius: var(--radius); object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); }
.person .avatar-photo { flex: none; width: 72px; height: 72px; border-radius: var(--radius); font-size: 28px; }
.person-body { min-width: 0; display: grid; gap: 6px; }
.person-name { font-size: var(--fs-md); font-weight: 650; line-height: var(--lh-tight); word-break: break-word; }
.person-name a { color: var(--text); }
.person-name a:hover { color: var(--link); text-decoration: none; }
.person-id { color: var(--muted); font-size: var(--fs-xs); font-weight: 500; margin-left: 4px; }
.person-boards { display: flex; flex-wrap: wrap; gap: 4px; }
.person-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-sm); }
.person-featured { grid-column: 1 / -1; }
.person-quiet { color: var(--muted); font-size: var(--fs-sm); }

/* ---- progress bar: <progress class="stat-bar" value max> ---- */
.stat-bar { display: block; width: 100%; min-width: 80px; max-width: 320px; height: 10px; border: 0; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; -webkit-appearance: none; appearance: none; }
.stat-bar::-webkit-progress-bar { background: var(--surface-2); border-radius: var(--radius-pill); }
.stat-bar::-webkit-progress-value { background: var(--accent); border-radius: var(--radius-pill); }
.stat-bar::-moz-progress-bar { background: var(--accent); border-radius: var(--radius-pill); }

/* ---- password strength meter: <span class="strength" data-level="1-4" hidden><span class="strength-bar"><i></i></span><span class="strength-text"></span></span> ---- */
/* ---- strength meter ---- */
.strength { display: flex; align-items: center; gap: var(--space-2); }
.strength[hidden] { display: none; }
.strength-bar { flex: 1; height: 6px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.strength-bar i { display: block; height: 100%; width: 0; background: var(--danger); transition: width var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.strength[data-level="1"] .strength-bar i { width: 25%; }
.strength[data-level="2"] .strength-bar i { width: 50%; }
.strength[data-level="3"] .strength-bar i { width: 75%; }
.strength[data-level="4"] .strength-bar i { width: 100%; }
.strength[data-level="2"] .strength-bar i { background: var(--warn); }
.strength[data-level="3"] .strength-bar i { background: var(--info); }
.strength[data-level="4"] .strength-bar i { background: var(--ok); }
.strength-text { font-size: var(--fs-xs); color: var(--text-2); min-width: 7ch; }

/* ---- yes/no settings: .settings > .setting (text on the left, a two-state radio control on the right) ---- */
.settings { display: grid; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setting-text strong { font-weight: 550; }
.setting-text .hint { color: var(--muted); font-size: var(--fs-xs); }
.segmented-radio { flex: none; }
.segmented-radio label { position: relative; display: inline-flex; cursor: pointer; }
.segmented-radio input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; }
.segmented-radio span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: calc(var(--radius-sm) - 3px); color: var(--text-2); font-size: var(--fs-sm); font-weight: 550; }
.segmented-radio input:checked + span { background: var(--accent); color: var(--on-accent); }
.segmented-radio input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 1px; }

/* =====================================================================================================================
 * W42: softer shapes and links you can tell apart. Small buttons are pills; action links are soft pill buttons
 * (.btn-soft) grouped in an .action-bar; breadcrumbs, page links and meta numbers are chips; tables are rounded boxes.
 * Text links stay text (blue, underline on hover). Rules: docs/design/README.md ("Shape" and "Links, pills, chips").
 * ================================================================================================================== */

/* ---- pill buttons: every small button is a chip; .btn-pill rounds a full-size one ---- */
.btn-sm, .btn-pill { border-radius: var(--radius-pill); }
.btn-sm { padding: 0 12px; }
.btn-sm.btn-square, .btn-pill.btn-square { padding: 0; }

/* ---- soft button: an action that must read as clickable without competing with the primary ---- */
.btn-soft { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
.btn-soft:hover, details[open] > summary.btn-soft {
  background: var(--link-soft); border-color: color-mix(in srgb, var(--link) 35%, transparent); color: var(--link);
}
.btn-soft .icon { color: currentColor; opacity: .85; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* ---- action bar: a row of pill actions (post foot, author links, page toolbars) ---- */
.action-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.action-bar form { margin: 0; }

/* ---- pills: link chips get a clear hover, focus and current state ---- */
a.pill:hover { background: var(--link-soft); border-color: color-mix(in srgb, var(--link) 35%, transparent); color: var(--link); }
.pill[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.pill .icon { width: 14px; height: 14px; vertical-align: 0; }

/* ---- stat chips: read-only numbers (Pregleda, Odgovora) as quiet chips ---- */
.stat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.stat-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 11px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stat-chip strong { color: var(--text); font-weight: 650; }
.stat-chip .icon { width: 14px; height: 14px; vertical-align: 0; color: var(--muted); }

/* ---- breadcrumbs: chips with a chevron between them; the current page is plain text ---- */
.breadcrumbs ol { gap: 6px; margin-bottom: var(--space-2); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.breadcrumbs li + li::before {
  content: ""; width: 6px; height: 6px; margin: 0 2px 0 0; border: solid var(--border-strong); border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}
.breadcrumbs a {
  display: inline-flex; align-items: center; min-height: 26px; max-width: 32ch; padding: 0 10px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.breadcrumbs a:hover { background: var(--link-soft); border-color: color-mix(in srgb, var(--link) 35%, transparent); color: var(--link); text-decoration: none; }
.breadcrumbs [aria-current] { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }

/* ---- pager: pills, the current page filled ---- */
.page { border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); font-variant-numeric: tabular-nums; }
.page:hover { background: var(--link-soft); border-color: color-mix(in srgb, var(--link) 35%, transparent); color: var(--link); }
.page.current { border-color: var(--accent); }
.page.current:hover { background: var(--accent); color: var(--on-accent); }

/* ---- tables in the forum: a rounded box inside the card, quiet head row, separators and row hover ---- */
.theme-modern .table-wrap { margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.theme-modern .table thead th {
  background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); text-transform: none; letter-spacing: 0;
  border-bottom-color: var(--border);
}
.theme-modern .table th, .theme-modern .table td { padding: 10px 14px; }
.theme-modern .table thead th:first-child { border-top-left-radius: calc(var(--radius-sm) - 1px); }
.theme-modern .table thead th:last-child { border-top-right-radius: calc(var(--radius-sm) - 1px); }

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
