/* Forum design system: the website's design (../web/static/css/site.css): blue owns the chrome,
   orange is the ONLY action colour (text on orange = navy), Bricolage Grotesque + Hanken Grotesk. */
:root {
  --blue: #0B649B;
  --navy: #082F4A;
  --ink: #0E2433;
  --ink-2: #3B5263;
  --ground: #EEF3F6;
  --ground-2: #E1EAF0;
  --paper: #FFFFFF;
  --orange: #FF9800;
  --orange-hover: #FFAB2E;
  --sky: #BFE0F5;
  --line: #CFDAE2;
  --danger: #A12B1F;

  --display: "Bricolage Grotesque", "Bricolage Fallback", "Hanken Grotesk", system-ui, sans-serif;
  --text: "Hanken Grotesk", "Hanken Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: 1.25rem;
  --max: 1280px;
  --read: 760px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 0.2em; }
a:hover { color: var(--navy); }
::selection { background: var(--orange); color: var(--navy); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
/* orange on the pale ground is too faint on its own: add a navy inner ring on light surfaces */
main :focus-visible { outline-color: var(--blue); }

h1, h2, h3 { font-family: var(--display); font-weight: 650; letter-spacing: -0.02em; color: var(--ink); line-height: 1.12; margin: 0 0 0.6em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; text-wrap: pretty; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: calc(var(--read) + 2 * var(--gutter)); }
.centered { text-align: center; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 100;
  background: var(--orange); color: var(--navy); font-weight: 600; padding: 0.6rem 1rem; border-radius: 10px;
}
.skip-link:focus { top: 0.75rem; }

/* ---- Buttons: the website's pill, orange is the action colour ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 2.75rem; padding: 0.7rem 1.6rem;
  border: 2px solid var(--orange);
  border-radius: 999px;
  background: var(--orange);
  color: var(--navy);
  font: 600 1rem/1.2 var(--text);
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.btn:hover { background: var(--orange-hover); border-color: var(--orange-hover); color: var(--navy); }
.btn:active { transform: translateY(1px); }
.btn-small { min-height: 2.75rem; padding: 0.5rem 1.2rem; font-size: 0.95rem; }
.btn-outline { background: transparent; border-color: currentColor; color: var(--ink); }
.btn-outline:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-red { /* historic class name: the primary orange button */ }

/* ---- Header: the website's blue bar ---- */
.test-banner + .site-header, .site-header { background: var(--blue); color: #fff; position: sticky; top: 0; z-index: 40; }
.header-row { display: flex; align-items: center; gap: 1.25rem; min-height: 4.5rem; padding-block: 0.5rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; line-height: 1; color: #fff; text-decoration: none; font: 700 1.15rem/1 var(--display); letter-spacing: -0.01em; flex: none; }
.brand { min-height: 2.75rem; }
.brand img { width: 40px; height: 40px; }
.brand span { display: flex; flex-direction: column; gap: 3px; }
.brand small { font: 500 0.78rem/1 var(--text); letter-spacing: 0.01em; color: var(--sky); }
.brand:hover { color: #fff; }
.site-header .site-nav { margin-left: auto; }
.header-row.has-search .site-nav { margin-left: 0; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.15rem; }
.site-nav a:not(.btn) { position: relative; display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.75rem; border-radius: 999px; color: #fff; text-decoration: none; font: 500 0.98rem/1 var(--text); white-space: nowrap; }
.site-nav a:not(.btn):hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.site-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.3rem; height: 2px; border-radius: 2px; background: var(--orange); }
.site-nav .btn-small { margin-left: 0.4rem; }
.site-nav .btn-outline { border-color: #fff; color: #fff; }
.site-nav .btn-outline:hover { background: #fff; border-color: #fff; color: var(--navy); }

.nav-toggle { display: none; }

@media (max-width: 760px) {
  .site-header { position: relative; }
  .header-row { min-height: 4rem; }
  .js .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
    width: 48px; height: 48px; padding: 0; background: rgba(255, 255, 255, 0.14); border: 0; border-radius: 999px; cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px;
    transition: transform 0.2s, background-color 0.2s;
  }
  .nav-toggle-bars { position: relative; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -7px; }
  .nav-toggle-bars::after { top: 7px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

  .site-header .site-nav { position: absolute; left: 0; right: 0; top: 100%; margin: 0; background: var(--navy); box-shadow: 0 18px 30px -18px rgba(8, 47, 74, 0.8); }
  .js .site-nav { display: none; }
  .js .nav-toggle[aria-expanded="true"] + .site-nav { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem var(--gutter) 1.25rem; }
  .site-nav li { border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
  .site-nav li:last-child { border: 0; padding-top: 1rem; }
  .site-nav a:not(.btn) { display: flex; padding: 0.85rem 0; border-radius: 0; font: 600 1.25rem/1.2 var(--display); }
  .site-nav a:not(.btn):hover { background: none; }
  .site-nav a[aria-current="page"]::after { left: 0; right: auto; width: 1.5rem; bottom: 0.45rem; }
  .site-nav .btn { display: flex; }
  .site-nav .btn-small { margin-left: 0; }
}

/* ---- Sections ---- */
.section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.section-white { background: var(--paper); }
.section-soft { background: var(--ground); }
.page-head { padding-block: clamp(3rem, 8vw, 6rem); min-height: 50vh; }
.heading-red { color: var(--danger); }
.eyebrow { display: inline-flex; align-items: center; gap: 0.75rem; font: 600 1rem/1 var(--text); color: var(--blue); margin-bottom: 0.9rem; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--orange); }

/* ---- Landing blocks ---- */
.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; margin-top: 2.5rem; }
.points p { color: var(--ink-2); margin: 0; }
.points h3 { font-size: 1.3rem; }
@media (max-width: 760px) { .points { grid-template-columns: 1fr; gap: 2rem; } }

.price-block { display: flex; align-items: center; justify-content: space-between; gap: 2.5rem; flex-wrap: wrap; }
.price-block > div { flex: 1 1 28rem; max-width: 40rem; }
.price-block p { margin: 0; }
.price-block h2 { margin-bottom: 0.4em; }

/* ---- Footer: the website's blue footer ---- */
.site-footer { background: var(--blue); color: #fff; padding: 4rem 0 0; font-size: 1rem; margin-top: 3rem; }
.site-footer p { color: #E3F1FA; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--orange); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem 2.5rem; }
.footer-title { font: 600 1rem/1 var(--text); color: var(--sky) !important; margin-bottom: 0.9rem; }
.footer-grid > div:first-child .footer-title { display: flex; align-items: center; gap: 0.9rem; font: 800 1.5rem/1 var(--display); color: #fff !important; letter-spacing: -0.01em; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links a, .footer-grid p a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.footer-base { margin-top: 3rem; padding-bottom: 1.4rem; font-size: 0.92rem; }
.footer-base p { margin: 0; padding-top: 1.4rem; border-top: 1px solid rgba(255, 255, 255, 0.2); color: #CFE6F5; }
.footer-base .footer-operator { padding-top: 0.4rem; border-top: 0; font-size: 0.85rem; }
.footer-operator span { white-space: nowrap; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

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

/* ---- Forms and cards ---- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: clamp(1.5rem, 4vw, 2.5rem); }
.form-page { min-height: 60vh; padding-block: clamp(2rem, 6vw, 4.5rem); }
.form-card { max-width: 32rem; margin-inline: auto; }
.form-card h1 { font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.4rem); }
.lead { color: var(--ink-2); }
.field { margin-bottom: 1.25rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; color: var(--ink); }
.field input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%; min-height: 2.9rem; padding: 0.7rem 0.95rem; font: inherit; color: var(--ink);
  background: var(--ground); border: 1px solid #7A93A5; border-radius: 12px;
}
.field input:not([type="checkbox"]):not([type="radio"]):focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--blue); background: var(--paper); }
.field.has-error input:not([type="checkbox"]) { border-color: var(--danger); }
.field-hint { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--ink-2); }
.field-error { margin: 0.35rem 0 0; font-size: 0.95rem; color: #b3201a; font-weight: 600; }
.check-label { display: flex; gap: 0.7rem; align-items: flex-start; font-weight: 400 !important; }
.check-label input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; flex: none; accent-color: var(--blue); }
.form-error, .form-notice { padding: 0.8rem 1rem; border-radius: 10px; margin-bottom: 1.25rem; }
.form-error { background: #fdeceb; border: 1px solid #f0b5b1; color: #8f1d17; }
.form-notice { background: #edf6f0; border: 1px solid #b7d9c3; color: #1d5b37; }
.form-actions { margin: 1.5rem 0 0; }
.form-alt { margin: 1rem 0 0; font-size: 0.95rem; }
.form-actions .btn { width: 100%; text-align: center; }
@media (min-width: 480px) { .form-actions .btn { width: auto; } }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.logout-form { margin: 0; }
.lang-switch { margin: 0; display: inline-flex; align-items: center; gap: 0.15rem; color: var(--sky); }
.lang-switch button { background: none; border: 0; padding: 0.4rem 0.35rem; font: inherit; font-size: 0.9rem; letter-spacing: 0.04em; color: #fff; cursor: pointer; touch-action: manipulation; border-radius: 6px; }
.lang-switch button:hover { color: var(--orange); }
.lang-switch button[aria-current="true"] { font-weight: 700; color: #fff; text-decoration: underline 2px var(--orange); text-underline-offset: 0.3em; cursor: default; }
@media (max-width: 760px) { .lang-switch button { min-height: 2.75rem; min-width: 2.75rem; } }
.site-nav .logout-form .btn { background: transparent; }
.test-banner + .site-header { top: 0; }
.outbox-item { margin-bottom: 1rem; }
.outbox-item h2 { font-size: 1.25rem; margin-bottom: 0.2rem; }
.outbox-meta { font-size: 0.85rem; color: var(--ink-2); }
.outbox-item pre { white-space: pre-wrap; word-break: break-word; font: 0.9rem/1.5 ui-monospace, monospace; margin: 0; }

/* ---- Facts, profile, lists ---- */
.facts { margin: 1.25rem 0; }
.facts div { padding: 0.7rem 0; border-top: 1px solid var(--line); }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font-size: 0.9rem; color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 600; color: var(--ink); }
.form-actions-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.form-actions-row .btn { width: auto; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 27rem), 1fr)); gap: 1.5rem; align-items: start; }
.profile-grid > .card:has(.table-wrap) { grid-column: 1 / -1; }
.profile-grid h2 { font-size: 1.4rem; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 0.6rem 0; border-top: 1px solid var(--line); }
.muted { color: var(--ink-2); font-size: 0.95rem; }
.tag { display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.6rem; border-radius: 60px; background: var(--ground-2); font-size: 0.8rem; }
.request-row { padding: 0.9rem 0; border-top: 1px solid var(--line); }
.request-row p { margin-bottom: 0.6rem; }
.request-actions { display: flex; gap: 0.6rem; }
.request-actions form { margin: 0; }

/* ---- Tables and admin ---- */
@media (max-width: 600px) {
  .data-table.stack thead { display: none; }
  .data-table.stack, .data-table.stack tbody, .data-table.stack tr, .data-table.stack td { display: block; width: 100%; }
  .data-table.stack tr { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
  .data-table.stack td { border: 0; padding: 0.15rem 0; }
  .data-table.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-2); }
}
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 2px solid var(--line); white-space: nowrap; }
.data-table td { padding: 0.7rem 0.75rem 0.7rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.profile-grid.wide { grid-template-columns: minmax(0, 1fr); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.admin-actions form, .row-actions form { margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.data-table td .row-actions { padding-bottom: 0.2rem; }

/* ================= Forum ================= */
[hidden] { display: none !important; }
select {
  width: 100%; min-height: 2.9rem; padding: 0.7rem 0.95rem; font: inherit; color: var(--ink);
  background: var(--ground); border: 1px solid #7A93A5; border-radius: 12px;
}
select:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.field select:focus-visible, .field textarea:focus-visible { outline-offset: 1px; }

.forum-page { background: var(--ground); padding: clamp(1.25rem, 4vw, 2.5rem) 0 clamp(3rem, 7vw, 5rem); min-height: 70vh; }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; font-size: 0.95rem; margin-bottom: 0.75rem; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; }
.crumbs a + a::before { content: "/"; margin-right: 0.5rem; color: #999; }
.forum-head, .topic-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; margin-bottom: 1.25rem; }
.forum-head h1 { margin: 0; font-size: clamp(2rem, 1.5rem + 2vw, 2.7rem); }
.forum-lead { margin: 0.35rem 0 0; color: var(--ink-2); max-width: 34rem; }
.topic-head { display: block; }
.topic-head h1 { font-size: clamp(1.7rem, 1.3rem + 1.8vw, 2.3rem); line-height: 1.2; margin-bottom: 0.5rem; overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.75rem; }
.badges:empty { display: none; }

.forum-col { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 1.25rem; overflow: hidden; }
.forum-pad { padding: clamp(1.1rem, 4vw, 2rem); }
.col-title { font: 600 1.05rem/1.3 var(--text); color: var(--ink); margin: 0; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.forum-pad .col-title { padding: 0 0 0.75rem; }

.badge { display: inline-block; padding: 0.05rem 0.6rem; border-radius: 60px; background: var(--ground-2); color: #444; font-size: 0.8rem; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.badge-ok { background: #e3f3ea; color: #17613a; }
.badge-new { background: var(--blue); color: #fff; }
.badge-warn { background: #fdeceb; color: #8f1d17; }

.empty { padding: 2.25rem 1.25rem; text-align: center; color: var(--ink-2); }
.empty p { margin-bottom: 1rem; }
.empty p:last-child { margin: 0; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.pager .muted { margin: 0; }

/* chips: quiet secondary actions */
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.25rem; padding: 0.25rem 0.9rem;
  border: 1px solid #7A93A5; border-radius: 60px; background: var(--paper); color: var(--ink);
  font: 600 0.9rem/1.2 var(--text); text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-on { background: #e8f1f7; border-color: var(--blue); color: #04476e; }
.chip-count { font-weight: 700; }
@media (pointer: coarse), (max-width: 520px) { .chip { min-height: 2.75rem; } }

/* posts: avatar column + body, XenForo/Discourse style */
.post { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: 0 0.9rem; padding: 1.1rem 1.4rem 0.9rem; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
.post:first-child { border-top: 0; }
.post.is-brand { background: #fffaf1; box-shadow: inset 3px 0 0 var(--orange); }
.post.is-solution { box-shadow: inset 3px 0 0 #1f7a45; }
.post.is-hidden { opacity: 0.75; }
.post:target { background: #f3f8fb; }
.post-body { min-width: 0; }
.post-head { display: flex; flex-wrap: wrap; gap: 0 0.75rem; align-items: baseline; margin-bottom: 0.35rem; }
.post-name { margin: 0; font-weight: 700; color: var(--ink); line-height: 1.4; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: baseline; }
.post-sub { margin: 0; display: flex; flex-wrap: wrap; gap: 0 0.75rem; font-size: 0.88rem; color: var(--ink-2); }
.post .prose { max-width: 46rem; }
.date-link { color: inherit; text-decoration: none; }
.date-link:hover { text-decoration: underline; }
.real-author { font-size: 0.8rem; color: #8a5a00; }
.post-gone { grid-column: 1 / -1; margin: 0; color: var(--ink-2); font-style: italic; }
.avatar {
  flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--ground-2); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.05rem;
}
.avatar-brand { background: #fff; border: 1px solid var(--line); }
.avatar-brand img { width: 1.55rem; height: auto; }
.post-actions, .mod-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-top: 0.6rem; }
.post-actions form, .mod-actions form, .inline-form { margin: 0; display: inline-flex; gap: 0.5rem; align-items: center; }
.post-actions .muted { margin: 0; font-size: 0.9rem; }
/* PLAN §23A: post actions are small icon buttons (mask icons, currentColor); label = title + aria-label */
.post-actions { gap: 0.1rem; margin-left: -0.45rem; }
.act {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; min-width: 2rem; height: 2rem; padding: 0 0.45rem;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font: 600 0.88rem/1 var(--text); text-decoration: none; cursor: pointer;
}
.act .ico { width: 1.15rem; height: 1.15rem; }
.act:hover { background: var(--ground); color: var(--ink); }
.act.is-on { background: #e8f1f7; color: #04476e; }
.act.is-on:hover { background: #d9e9f3; }
.act-static, .act-static:hover { background: transparent; color: var(--ink-2); cursor: default; }
a.act[href$="/vymazat"]:hover { color: var(--danger); }
.ico-a-helpful { --ico: url(/static/img/post/helpful.svg); } .act.is-on .ico-a-helpful { --ico: url(/static/img/post/helpful-on.svg); }
.ico-a-reply { --ico: url(/static/img/post/reply.svg); } .ico-a-solved { --ico: url(/static/img/post/solved.svg); }
.ico-a-report { --ico: url(/static/img/post/report.svg); } .ico-a-edit { --ico: url(/static/img/post/edit.svg); }
.ico-a-delete { --ico: url(/static/img/post/delete.svg); } .ico-a-hide { --ico: url(/static/img/post/hide.svg); }
.ico-a-show { --ico: url(/static/img/post/show.svg); }
.notice-warn { background: #fff7e6; border-color: #f0d9a8; color: #6b4600; font-size: 0.95rem; padding: 0.5rem 0.8rem; }

.solved-box { margin: 0; padding: 1.1rem 1.25rem 1.25rem; background: #edf6f0; border-top: 1px solid #b7d9c3; border-bottom: 1px solid #b7d9c3; }
.solved-title { margin: 0 0 0.6rem; font-weight: 700; color: #17613a; }
.solved-foot { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin-top: 0.75rem; font-size: 0.95rem; }
.solved-foot form { margin: 0; }
.solved-box a { color: #0b5a85; }

.mod-box { border-style: dashed; padding-block: 0.4rem; }
.mod-box summary { cursor: pointer; font-weight: 600; padding: 0.4rem 0; }
.mod-actions { margin: 0 0 0.6rem; }
.move-form select { width: auto; max-width: 13rem; padding: 0.35rem 0.6rem; font-size: 0.9rem; border-radius: 60px; }

.reply-box { padding: 0.25rem 1.4rem 1.5rem; }
.reply-box .col-title { padding-inline: 0; border-bottom: 0; padding-bottom: 0.5rem; }
.reply-box .field { margin-bottom: 0.9rem; }
.reply-box .form-actions { margin-top: 0.5rem; }

/* user markdown */
.prose { overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h3 { font-size: 1.3rem; margin: 1.2em 0 0.4em; }
.prose h4 { font: 700 1.1rem/1.3 var(--text); margin: 1.1em 0 0.3em; }
.prose blockquote { margin: 1em 0; padding: 0.1em 0 0.1em 1rem; border-left: 3px solid var(--line); color: var(--ink-2); }
.prose code { font: 0.92em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--ground); padding: 0.1em 0.35em; border-radius: 4px; }
.prose pre { background: var(--ground); padding: 0.8rem 1rem; border-radius: 8px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose a[href^="/uploads/"]:not(:has(img)) { display: inline-block; padding: 0.05rem 0.7rem; background: var(--ground); border: 1px solid var(--line); border-radius: 60px; text-decoration: none; font-size: 0.95rem; }
.prose img { display: block; max-width: 100%; height: auto; border-radius: 8px; margin: 0.75em 0; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1em 0; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.4rem 0.7rem; text-align: left; }
.prose th { background: var(--ground); }

/* editor: like Gmail's compose box (one card: text, toolbar, send row) */
.editor [hidden] { display: none !important; }
.editor-label { display: block; font-weight: 600; margin-bottom: 0.35rem; color: var(--ink); }
.editor-box { position: relative; background: var(--paper); border: 1px solid #7A93A5; border-radius: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.editor-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.has-error .editor-box { border-color: var(--danger); }
.editor-surface, .editor textarea { display: block; width: 100%; padding: 0.85rem 1rem; font: inherit; line-height: 1.55; color: var(--ink); background: transparent; border: 0; border-radius: 12px 12px 0 0; outline: 0; overflow: auto; max-height: 60vh; }
.editor textarea { resize: vertical; }
.editor-surface.is-l, .editor textarea.is-l { min-height: 12rem; }
.editor-surface.is-m, .editor textarea.is-m { min-height: 8rem; }
.editor-surface.is-s, .editor textarea.is-s { min-height: 5.5rem; }
.editor-surface img { cursor: default; max-height: 12rem; width: auto; }
.editor-surface blockquote { margin: 0.6em 0; }
.editor-surface a { cursor: text; }
.editor-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0 1rem 0.6rem; list-style: none; }
.chip-file { display: inline-flex; align-items: center; gap: 0.35rem; max-width: 100%; padding: 0.15rem 0.2rem 0.15rem 0.6rem; background: var(--ground); border: 1px solid var(--line); border-radius: 60px; font-size: 0.92rem; }
.chip-file > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-file button { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; }
.chip-file button:hover { background: var(--ground-2); color: var(--ink); }
.editor-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem; padding: 0.3rem 0.6rem; border-top: 1px solid var(--ground-2); }
.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.55rem 0.75rem 0.7rem; }
.editor-extra { display: inline-flex; gap: 0.1rem; margin-left: 0.25rem; }
.editor-actions .check-label { margin-left: auto; font-size: 0.95rem; }
.tool { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #444746; cursor: pointer; }
.tool:hover:not(:disabled) { background: var(--ground-2); }
.tool:disabled { opacity: 0.35; cursor: default; }
.tool[aria-pressed="true"] { background: #e1ebf2; color: var(--blue); }
.tool-sep { align-self: stretch; width: 1px; margin: 0.4rem 0.35rem; background: var(--line); }
.ico { display: block; width: 1.25rem; height: 1.25rem; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.chip-file .ico-attach { width: 1rem; height: 1rem; }
.chip-file .ico-close { width: 0.95rem; height: 0.95rem; }
.ico-undo { --ico: url(/static/img/editor/undo.svg); } .ico-redo { --ico: url(/static/img/editor/redo.svg); }
.ico-bold { --ico: url(/static/img/editor/bold.svg); } .ico-italic { --ico: url(/static/img/editor/italic.svg); }
.ico-underline { --ico: url(/static/img/editor/underline.svg); } .ico-ol { --ico: url(/static/img/editor/ol.svg); }
.ico-ul { --ico: url(/static/img/editor/ul.svg); } .ico-quote { --ico: url(/static/img/editor/quote.svg); }
.ico-link { --ico: url(/static/img/editor/link.svg); } .ico-image { --ico: url(/static/img/editor/image.svg); }
.ico-attach { --ico: url(/static/img/editor/attach.svg); } .ico-clear { --ico: url(/static/img/editor/clear.svg); }
.ico-close { --ico: url(/static/img/editor/close.svg); }
.link-pop { position: absolute; left: 0.75rem; bottom: 3.6rem; z-index: 5; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.5rem 0.75rem; width: min(32rem, calc(100% - 1.5rem)); padding: 0.8rem 0.9rem; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }
.link-pop[hidden] { display: none; }
.link-pop label { font-weight: 600; font-size: 0.95rem; }
.link-pop input { min-width: 0; padding: 0.45rem 0.65rem; font: inherit; border: 1px solid #7A93A5; border-radius: 8px; }
.link-pop-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.editor-status { margin: 0.25rem 0 0; min-height: 1.4em; font-size: 0.9rem; color: var(--ink-2); }

/* review pass (web-interface-guidelines) */
.btn, .chip, .tool, .nav-toggle, .collapse, .side-list a, .tabs-inline a { touch-action: manipulation; }
.forum-head h1, .topic-head h1, .forum-lead { text-wrap: balance; }

/* ---- Search (stage 5) ---- */
.site-search { position: relative; flex: 1; max-width: 40rem; margin-inline: auto; }
.site-search input[type="search"], .search-page-form input[type="search"] {
  width: 100%; padding: 0.6rem 2.75rem 0.6rem 1rem; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 2px solid transparent; border-radius: 999px; min-height: 2.75rem; -webkit-appearance: none; appearance: none;
}
.search-page-form input[type="search"] { border-color: var(--line); }
.site-search input[type="search"]:focus-visible, .search-page-form input[type="search"]:focus-visible {
  outline: 3px solid var(--orange); outline-offset: 2px; background: var(--paper);
}
.site-search-go {
  position: absolute; right: 0.15rem; top: 0; bottom: 0; width: 2.75rem; display: flex; align-items: center;
  justify-content: center; background: none; border: 0; color: var(--ink-2); cursor: pointer; border-radius: 60px;
}
.site-search-go:hover { color: var(--blue); }
.search-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 0.4rem); z-index: 30; list-style: none; margin: 0; padding: 0.35rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}
.search-pop[hidden] { display: none; }
.search-pop li { border-radius: 10px; }
.search-pop a { display: block; padding: 0.55rem 0.75rem; text-decoration: none; color: var(--ink); border-radius: 10px; }
.search-pop li[aria-selected="true"], .search-pop li:hover { background: #e8f1f7; }
.opt-title { display: block; font-weight: 600; color: var(--ink); line-height: 1.35; overflow-wrap: anywhere; }
.opt-meta { display: block; font-size: 0.85rem; color: var(--ink-2); }
.opt-all a { color: var(--blue); font-weight: 600; font-size: 0.95rem; }
mark { background: #fff0c2; color: inherit; border-radius: 3px; padding: 0 0.1em; }

@media (max-width: 760px) {
  .header-row { flex-wrap: wrap; }
  .site-search { order: 3; flex: 1 0 100%; max-width: none; margin: 0 0 0.5rem; }
}

.search-page-form { display: flex; gap: 0.75rem; margin-bottom: 1.25rem; }
.search-page-form input[type="search"] { padding-right: 1rem; min-height: 3rem; }
.search-page-form .btn { flex: none; }
@media (max-width: 480px) { .search-page-form { flex-direction: column; } }
.search-count { margin: 0 0 0.75rem; color: var(--ink-2); }
.result-list { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.result { padding: 1rem 1.25rem; border-top: 1px solid var(--line); }
.result:first-child { border-top: 0; }
.result-title { margin: 0 0 0.25rem; display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; align-items: baseline; }
.result-title a { font-weight: 600; font-size: 1.15rem; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.result-title a:hover { color: var(--blue); text-decoration: underline; }
.result-snippet { margin: 0 0 0.35rem; color: var(--ink); font-size: 0.98rem; overflow-wrap: anywhere; }
.ask-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 1rem 1.25rem; background: var(--paper);
  border: 1px solid var(--line); border-radius: 14px; }
.ask-cta p { margin: 0; font-weight: 600; color: var(--ink); }

.similar { margin-top: 0.75rem; padding: 0.75rem 1rem; background: var(--ground); border-radius: 10px; }
.similar[hidden] { display: none; }
.similar-title { margin: 0 0 0.35rem; font-weight: 600; color: var(--ink); font-size: 0.95rem; }
.similar ul { list-style: none; margin: 0; padding: 0; }
.similar li { padding: 0.25rem 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; align-items: baseline; }
.similar a { overflow-wrap: anywhere; }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; display: none; }

/* ---- Notifications (stage 6) ---- */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: 1rem; border-radius: 60px; }
.bell img { filter: brightness(0) invert(1); }
.bell:hover { background: rgba(255, 255, 255, 0.12); }
.bell-count {
  position: absolute; top: 3px; right: 1px; min-width: 1.15rem; height: 1.15rem; padding: 0 0.3rem; border-radius: 60px;
  background: var(--orange); color: var(--navy); font-size: 0.72rem; font-weight: 700; line-height: 1.15rem; text-align: center;
}
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { border-top: 1px solid var(--line); }
.notif:first-child { border-top: 0; }
.notif a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.25rem; color: var(--ink); text-decoration: none; }
.notif a:hover { background: #f3f8fb; }
.notif.is-unread { box-shadow: inset 3px 0 0 var(--blue); }
.notif.is-unread .notif-what { font-weight: 700; }
.notif-what { min-width: 0; overflow-wrap: anywhere; }
.notif-topic { color: var(--blue); }
.notif-when { flex: none; font-size: 0.85rem; color: var(--ink-2); white-space: nowrap; }
.watch-form { margin-bottom: 0.75rem; }
@media (max-width: 760px) { .bell { margin-left: auto; margin-right: 0.25rem; } }
@media (max-width: 600px) { .notif a { flex-direction: column; gap: 0.2rem; } }

/* ---- Admin and moderation (stage 7) ---- */
.admin-page h1 { font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.4rem); }
.admin-nav, .tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.25rem; }
.admin-page .wrap > .card, .admin-page .profile-grid > .card { margin-bottom: 1.25rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.stat { display: flex; flex-direction: column; gap: 0.15rem; padding: 1rem 1.1rem; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; }
a.stat:hover { border-color: var(--ink); }
.stat-n { font: 400 2.2rem/1 var(--display); color: var(--ink); }
.stat-l { font-size: 0.9rem; color: var(--ink-2); line-height: 1.3; }
.stat.is-alert { border-color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); }
.status-list li { display: flex; justify-content: space-between; }
.admin-search, .inline-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1.25rem; }
.admin-search input[type="search"] { flex: 1 1 14rem; max-width: 24rem; padding: 0.6rem 1rem; font: inherit; border: 1px solid #7A93A5; border-radius: 60px; background: var(--paper); }
.admin-search select, .inline-row select { width: auto; max-width: 100%; flex: 0 1 18rem; }
.inline-row { margin-bottom: 0.5rem; }
.contact-form { margin: 1rem 0 0; }
.report-head { display: flex; flex-wrap: wrap; gap: 0.3rem 0.75rem; align-items: center; margin-bottom: 0.6rem; }
.report-head .muted { margin: 0; }
.report-detail { margin: 0 0 0.75rem; font-style: italic; }
.report-post { margin: 0 0 1rem; padding: 0.6rem 0 0.6rem 1rem; border-left: 3px solid var(--line); }
.report-post p { margin: 0 0 0.4rem; overflow-wrap: anywhere; }
.report-post footer { font-size: 0.9rem; color: var(--ink-2); }
.reason-set { border: 0; padding: 0; margin: 0 0 1.25rem; }
.reason-set legend { font-weight: 600; color: var(--ink); margin-bottom: 0.5rem; padding: 0; }
.reason-set .check-label { margin-bottom: 0.4rem; }
.form-card textarea { display: block; width: 100%; padding: 0.7rem 0.85rem; font: inherit; color: var(--ink); border: 1px solid #7A93A5; border-radius: 10px; resize: vertical; }
.field-narrow input { max-width: 8rem; }
.cat-delete { margin-top: 0.6rem; }
.audit-detail { overflow-wrap: anywhere; font-size: 0.9rem; color: var(--ink-2); }

/* Touch targets: on phones and touch screens every control is at least 44 x 44 px (stage 8 mobile pass). */
@media (max-width: 760px), (pointer: coarse) {
  .btn-small { min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; }
  .act { min-width: 2.75rem; height: 2.75rem; }
  .cat-tag, .similar-list a, .side-solved a { min-height: 2.75rem; display: inline-flex; align-items: center; }
  .topic-link, .crumbs a, .solved-foot a, .status-list a, .topic-meta a {
    display: inline-flex; align-items: center; min-height: 2.75rem;
  }
  .topic-meta { align-items: center; }
  .topic-meta a { padding-inline: 0.15rem; }
  .crumbs a, .status-list a { min-width: 2.75rem; }
  .tool { width: 2.75rem; height: 2.75rem; }
  .chip-file button { width: 2.75rem; height: 2.75rem; }
  .check-label { align-items: center; min-height: 2.75rem; }
  .check-label input { margin-top: 0; }
  .mod-box summary { display: flex; align-items: center; min-height: 2.75rem; }
  select, .move-form select { min-height: 2.75rem; }
}

/* Amounts and dates line up in tables */
.data-table td, .stat-n { font-variant-numeric: tabular-nums; }

/* ================= Desktop-first forum layout (PLAN §12.1) ================= */
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.page-head-row h1 { margin: 0; font-size: clamp(1.7rem, 1.35rem + 1vw, 2.2rem); display: flex; align-items: center; gap: 0.6rem; }
.page-head-row .forum-lead { margin-top: 0.2rem; }
.forum-wrap.is-single { max-width: 56rem; margin-inline: auto; }
.forum-layout { display: grid; gap: 1.5rem; align-items: start; }
.forum-layout.has-side { grid-template-columns: 18.5rem minmax(0, 1fr); }
.forum-layout.has-aside { grid-template-columns: minmax(0, 1fr) 17.5rem; }
.forum-main { min-width: 0; }
.ask-mobile { display: none; }

.side { position: sticky; top: 1rem; }
.side-ask { display: block; text-align: center; margin-bottom: 1.25rem; }
.side-title { margin: 0 0 0.4rem; padding-inline: 0.7rem; font: 600 0.9rem/1.3 var(--text); color: var(--ink-2); }
.side-card .side-title { padding-inline: 0; color: var(--ink); font-size: 1rem; }
.side-list { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.side-list a { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.7rem; border-radius: 10px; color: var(--ink); text-decoration: none; line-height: 1.35; }
.side-list a:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); }
.side-list a[aria-current] { background: var(--paper); font-weight: 600; color: var(--ink); box-shadow: inset 3px 0 0 var(--blue); }
.side-name { min-width: 0; overflow-wrap: anywhere; }
.side-count { margin-left: auto; font-size: 0.85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* Category cards with a star (PLAN_FORUM.md §18). The star is the category follow. */
.cat-cards { display: grid; gap: 1.1rem; }
.cat-group[hidden] { display: none; }
.cat-group .side-title { padding-inline: 0.15rem; }
.cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.cat-card { display: flex; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.cat-card:hover { border-color: #7A93A5; }
.cat-card.is-current { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.cat-link { flex: 1 1 auto; min-width: 0; display: flex; gap: 0.7rem; padding: 0.75rem 0 0.75rem 0.8rem; color: var(--ink); text-decoration: none; border-radius: 12px; }
.cat-link:hover .cat-name { color: var(--blue); }
.cat-link .dot { align-self: stretch; width: 0.28rem; height: auto; min-height: 2.4rem; border-radius: 3px; }
.cat-body { min-width: 0; display: grid; gap: 0.15rem; }
.cat-name { font-weight: 600; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; }
.cat-desc { font-size: 0.9rem; line-height: 1.4; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-meta { font-size: 0.82rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cat-meta .sep { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: currentColor; vertical-align: middle; margin: 0 0.45rem; }
.cat-star-form { flex: none; margin: 0; }
.cat-star { flex: none; display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; margin: 0; border: 0; border-radius: 50%; background: transparent; color: #6b6b6b; cursor: pointer; text-decoration: none; touch-action: manipulation; }
.cat-star:hover { background: var(--ground-2); color: #8a5200; }
.cat-star .ico { width: 1.3rem; height: 1.3rem; --ico: url(/static/img/star-outline.svg); }
.cat-star[aria-pressed="true"] { color: #8a5200; }
.cat-star[aria-pressed="true"] .ico { --ico: url(/static/img/star-filled.svg); }
.cat-star:focus-visible, .cat-link:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.dot { flex: none; display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 3px; background: var(--blue); }
.dot-lg { width: 0.95rem; height: 0.95rem; }
.dot-0 { background: #07679e; } .dot-1 { background: #5B7C99; } .dot-2 { background: #d98200; }
.dot-3 { background: #2f8a57; } .dot-4 { background: #7a5ea8; } .dot-5 { background: #1d8a8a; }
.check-box { flex: none; width: 1rem; height: 1rem; border: 2px solid #8a8a8a; border-radius: 4px; background: var(--paper); }
.check-box.is-on { background: var(--blue); border-color: var(--blue); box-shadow: inset 0 0 0 2px var(--paper); }

.list-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 1rem; }
.list-card.empty { padding: 2.25rem 1.25rem; }
.list-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 0.6rem; border-bottom: 1px solid var(--line); }
.tabs-inline { display: flex; flex-wrap: wrap; }
.tabs-inline a { display: inline-block; padding: 0.8rem 0.9rem 0.7rem; margin-bottom: -1px; color: var(--ink-2); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.tabs-inline a:hover { color: var(--ink); }
.tabs-inline a[aria-current] { color: var(--ink); border-bottom-color: var(--blue); }

.topic-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.topic-table th { padding: 0.6rem 0.75rem; text-align: left; font: 600 0.85rem/1.3 var(--text); color: var(--ink-2); border-bottom: 1px solid var(--line); }
.topic-table td { padding: 0.75rem; vertical-align: middle; border-bottom: 1px solid var(--line); }
.topic-table tbody tr:last-child td { border-bottom: 0; }
.topic-table tbody tr:hover { background: #fafafa; }
.topic-table .c-topic { padding-left: 1.1rem; }
.topic-table .c-people { width: 8.5rem; }
.topic-table .c-num { width: 5.75rem; text-align: center; font-variant-numeric: tabular-nums; }
.topic-table .c-views { width: 6.5rem; color: var(--ink-2); }
.topic-table .c-when { width: 6.75rem; padding-right: 1.1rem; text-align: right; white-space: nowrap; color: var(--ink-2); font-size: 0.92rem; }
.num { font-weight: 700; color: var(--ink); }
.num:not(.has-replies) { font-weight: 400; color: var(--ink-2); }
.topic-line { margin: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 0.5rem; align-items: baseline; }
.topic-link { font-weight: 600; font-size: 1.06rem; line-height: 1.35; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.topic-link:hover { color: var(--blue); text-decoration: underline; }
.is-unread .topic-link { font-weight: 700; }
.topic-table tr.is-unread .c-topic { box-shadow: inset 3px 0 0 var(--blue); }
.topic-meta { margin: 0.1rem 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.9rem; font-size: 0.88rem; color: var(--ink-2); }
.topic-meta a { color: inherit; text-decoration: none; }
.topic-meta a:hover { color: var(--blue); text-decoration: underline; }
.cat-tag { display: inline-flex; align-items: center; gap: 0.4rem; }
.topic-excerpt { margin: 0.2rem 0 0; font-size: 0.92rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people { display: flex; align-items: center; }
.avatar-xs { width: 1.75rem; height: 1.75rem; font-size: 0.75rem; margin-left: -0.4rem; border: 2px solid var(--paper); }
.avatar-xs:first-child { margin-left: 0; }
.avatar-xs.avatar-brand img { width: 0.95rem; }
.topic-excerpt mark { background: #fff0c2; }

.aside { display: grid; gap: 1rem; min-width: 0; }
.side-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; }
.info-list { margin: 0 0 0.75rem; }
.info-list div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid #eee; font-size: 0.95rem; }
.info-list dt { color: var(--ink-2); flex: none; }
.info-list dd { margin: 0; text-align: right; color: var(--ink); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.side-solved { margin: 0.75rem 0 0; font-weight: 600; }
.side-solved a { color: #17613a; }
.similar-list, .tips { list-style: none; margin: 0; padding: 0; }
.similar-list li { padding: 0.4rem 0; border-top: 1px solid #eee; line-height: 1.4; }
.similar-list li:first-child { border-top: 0; padding-top: 0; }
.similar-list a { overflow-wrap: anywhere; }
.tips li { padding: 0.35rem 0 0.35rem 1.1rem; position: relative; color: var(--ink-2); font-size: 0.95rem; }
.tips li::before { content: ""; position: absolute; left: 0; top: 0.95em; width: 0.4rem; height: 0.4rem; border-radius: 2px; background: var(--orange); }
.topic-head { margin-bottom: 1rem; }
.topic-head h1 { max-width: 60rem; }
.forum-col.reply-box { margin-top: 1rem; }
.search-page-form { max-width: none; }
.ask-cta { margin-bottom: 1rem; }

@media (max-width: 1099px) {
  .forum-layout.has-side, .forum-layout.has-aside { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .forum-layout.has-side .forum-main { order: -1; }
  .side { position: static; }
  .side-ask { display: none; }
  .ask-mobile { display: inline-flex; align-items: center; justify-content: center; }
  .side-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
  .side-list a { border: 1px solid #7A93A5; border-radius: 60px; background: var(--paper); min-height: 2.75rem; }
  .side-list a[aria-current] { border-color: var(--blue); box-shadow: none; }
  .side-count { margin-left: 0.2rem; }
  .side-title { padding-inline: 0; }
  .cat-list { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
}
@media (max-width: 560px) {
  .cat-list { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
  .cat-link { padding-block: 0.6rem; }
  .cat-link .dot { min-height: 1.6rem; }
  .cat-desc { -webkit-line-clamp: 1; }
}
@media (max-width: 760px) {
  .list-bar { padding-inline: 0.25rem; }
  .topic-table, .topic-table tbody, .topic-table tr, .topic-table td { display: block; }
  .topic-table thead { display: none; }
  .topic-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem 0.9rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); }
  .topic-table tbody tr:last-child { border-bottom: 0; }
  .topic-table td { padding: 0; border: 0; width: auto; }
  .topic-table .c-topic { flex: 1 0 100%; padding-left: 0; }
  .topic-table tr.is-unread .c-topic { box-shadow: none; }
  .topic-table tr.is-unread { box-shadow: inset 3px 0 0 var(--blue); }
  .topic-table .c-num, .topic-table .c-people, .topic-table .c-views, .topic-table .c-when { width: auto; padding: 0; text-align: left; }
  .topic-table .c-views { display: none; }
  .topic-table td[data-label]::after { content: " " attr(data-label); color: var(--ink-2); font-size: 0.88rem; }
  .topic-table .c-when { margin-left: auto; padding-right: 0; }
  .topic-excerpt { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .post { grid-template-columns: 2rem minmax(0, 1fr); gap: 0 0.6rem; padding: 1rem; }
  .post .avatar { width: 2rem; height: 2rem; font-size: 0.9rem; }
  .reply-box { padding-inline: 1rem; }
  .page-head-row { align-items: flex-start; }
}

/* topic filter on /forum */
.list-filter { margin: 0; flex: 0 1 17rem; }
.list-filter input[type="search"] { width: 100%; padding: 0.45rem 1rem; font: inherit; font-size: 0.95rem; color: var(--ink); background: var(--ground); border: 1px solid #7A93A5; border-radius: 60px; -webkit-appearance: none; appearance: none; }
.list-filter input[type="search"]:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; background: var(--paper); }
@media (max-width: 760px) { .list-bar { flex-wrap: wrap; padding-bottom: 0.6rem; } .list-filter { flex: 1 0 100%; } .list-filter input[type="search"] { min-height: 2.75rem; } }

/* ---- Threaded replies (PLAN §12.3, §23A): every level is a TAB. A rail runs from the parent's avatar down its
   children and an elbow leads into each child's avatar; the last child's rail ends in its elbow. ---- */
.thread-root, .thread { list-style: none; margin: 0; padding: 0; }
.thread-root > .node > .post { border-top: 1px solid var(--line); }
/* podpora.css also defines a bare .thread (a grid); .node > .thread wins over it */
.node > .thread { --rail: #7F9DB1; --av: 2rem; --elbow: 1.3rem; --y: 1.75rem; display: block; margin: 0 0 0 calc(2.65rem - 1px); }
.thread .thread { margin-left: calc(var(--av) / 2 - 1px); }
.thread > .node { position: relative; padding-left: var(--elbow); }
.thread > .node::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--rail); }
.thread > .node::after { content: ""; position: absolute; left: 0; top: calc(var(--y) - 2px); width: calc(var(--elbow) - 0.3rem); height: 2px; background: var(--rail); }
.thread > .node:last-child::before { display: none; }
.thread > .node:last-child::after { top: 0; height: var(--y); background: none; border-left: 2px solid var(--rail); border-bottom: 2px solid var(--rail); border-bottom-left-radius: 0.7rem; }
.thread .post { position: relative; padding: 0.75rem 0.6rem 0.35rem 0; border-top: 0; grid-template-columns: var(--av) minmax(0, 1fr); gap: 0 0.7rem; }
.thread .avatar { width: var(--av); height: var(--av); font-size: 0.95rem; }
.thread .post.is-brand, .thread .post.is-solution { box-shadow: -4px 0 0 var(--orange); }
.thread .post.is-solution { box-shadow: -4px 0 0 #1f7a45; }
.node.has-kids > .post { position: relative; }
.node.has-kids > .post::before { content: ""; position: absolute; width: 2px; background: var(--rail, #7F9DB1); left: calc(1.4rem + 1.25rem - 1px); top: calc(1.1rem + 2.5rem + 0.25rem); bottom: 0; }
.thread .node.has-kids > .post::before { left: calc(var(--av) / 2 - 1px); top: calc(0.75rem + var(--av) + 0.25rem); }
.node.has-kids > .post:has(.post-gone)::before { top: 0; }
.node.is-collapsed > .post::before { display: none; }
/* depth 5 and deeper stay on one level: the rail continues through their avatars like beads on a string */
.thread.is-flat { margin-left: 0; }
.thread.is-flat > .node { padding-left: 0; }
.thread.is-flat > .node::before { display: block; left: calc(var(--av) / 2 - 1px); }
.thread.is-flat > .node::after, .thread.is-flat > .node:last-child::after { display: none; }
.thread.is-flat > .node:last-child::before { display: block; bottom: auto; height: calc(var(--y)); }
.thread.is-flat .avatar { position: relative; z-index: 1; }
.reply-to { color: var(--ink-2); font-style: italic; }
.collapse { min-width: 1.8rem; padding: 0 0.15rem; border: 0; background: none; color: var(--ink-2); font: 600 0.88rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; border-radius: 6px; }
.collapse:hover { color: var(--blue); background: var(--ground); }
.node.is-collapsed > .thread, .node.is-collapsed > .post .post-body > :not(.post-head) { display: none; }
.node.is-collapsed > .post { padding-bottom: 0.6rem; }
.inline-reply { margin-top: 0.8rem; padding: 0.9rem 1rem 0.2rem; background: var(--ground); border-radius: 12px; }
.inline-reply .reply-for { margin: 0 0 0.5rem; font-size: 0.95rem; color: var(--ink-2); }
.reply-quote { margin: 0 0 1.25rem; padding: 0.4rem 0 0.4rem 1rem; border-left: 3px solid var(--line); color: var(--ink-2); max-height: 14rem; overflow: auto; }
@media (max-width: 760px) {
  .node > .thread { --av: 1.7rem; --elbow: 0.95rem; --y: 1.5rem; margin-left: calc(2rem - 1px); }
  .thread .thread { margin-left: calc(var(--av) / 2 - 1px); }
  .thread.is-flat { margin-left: 0; }
  .thread .post { padding: 0.65rem 0.4rem 0.3rem 0; gap: 0 0.5rem; }
  .thread .avatar { font-size: 0.8rem; }
  .node.has-kids > .post::before { left: calc(1rem + 1rem - 1px); top: calc(1rem + 2rem + 0.25rem); }
  .thread .node.has-kids > .post::before { left: calc(var(--av) / 2 - 1px); top: calc(0.65rem + var(--av) + 0.25rem); }
  .collapse { min-height: 2.75rem; min-width: 2.75rem; }
}
@media (max-width: 760px) {
  .editor-actions .check-label { margin-left: 0; flex-basis: 100%; }
  .editor-tools .tool-sep { display: none; }
}

/* ---- Test server: calm notice, not an alarm (TEST_BANNER=1) ---- */
.test-banner { background: #eaf3f9; border-bottom: 1px solid #c5dcea; color: #0a4a72; font-size: 0.9rem; line-height: 1.4; }
.test-banner .wrap { padding-block: 0.4rem; text-align: center; }
.test-note { background: #eaf3f9; border: 1px solid #c5dcea; color: #0a4a72; border-radius: 10px; padding: 0.7rem 1rem; font-size: 0.95rem; margin-bottom: 1.25rem; }

/* ---- Forum home: banners in the right column (PLAN_FORUM.md §24C) ---- */
.banners { display: grid; gap: 1rem; min-width: 0; align-content: start; }
.banner-card { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: var(--ink); text-decoration: none; min-width: 0; }
a.banner-card:hover { border-color: var(--blue); }
.banner-img { display: block; width: 100%; height: auto; max-height: 12rem; object-fit: cover; background: #eef3f7; }
.banner-body { display: grid; gap: 0.35rem; padding: 0.9rem 1.1rem 1rem; }
.banner-title { font: 600 1rem/1.35 var(--text); overflow-wrap: anywhere; }
a.banner-card .banner-title { color: var(--blue); }
.banner-text { color: var(--ink-2); font-size: 0.95rem; line-height: 1.45; overflow-wrap: anywhere; }
@media (min-width: 1100px) {
  .forum-layout.has-side.has-banners { grid-template-columns: 18.5rem minmax(0, 1fr) 15.5rem; }
  .banners { position: sticky; top: 1rem; }
  .has-banners .tabs-inline { flex-wrap: nowrap; }                 /* the narrower list keeps its three tabs on one line */
  .has-banners .tabs-inline a { padding-inline: 0.7rem; white-space: nowrap; }
  .has-banners .list-filter { min-width: 9rem; }
}
@media (max-width: 1099px) {
  .forum-layout.has-banners .banners { order: -1; }                /* with .forum-main: the list, then the banners, then the side nav */
}
@media (min-width: 640px) and (max-width: 1099px) {
  .banners { grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
}
/* admin page */
.banner-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.banner-head h2 { margin: 0; flex: 1; min-width: 0; font-size: 1.2rem; overflow-wrap: anywhere; }
.banner-thumb { width: 6rem; height: 4rem; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.banner-edit.is-off { background: #f6f8fa; }
.admin-page .field textarea { display: block; width: 100%; padding: 0.7rem 0.85rem; font: inherit; color: var(--ink); border: 1px solid #7A93A5; border-radius: 10px; resize: vertical; }
.banner-actions { margin-top: 0.75rem; }
