/* Colours of the pages, light and dark (A43): the same scheme as in sova.css (the light values
   first, the same dark values under prefers-color-scheme and under data-theme="dark"). */
:root { --muted: #666677; --line: #88888844; --ok: #1a7f37; --bad: #b3261e; --warn: #9a6700; --mark-bg: #fff2a8; --mark-fg: #1a1a1a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --muted: #a3abbd; --line: #88888866; --ok: #4ac26b; --bad: #ff8a80; --warn: #e3b341; --mark-bg: #5c4a00; --mark-fg: #fff3c4; }
}
:root[data-theme="dark"] { --muted: #a3abbd; --line: #88888866; --ok: #4ac26b; --bad: #ff8a80; --warn: #e3b341; --mark-bg: #5c4a00; --mark-fg: #fff3c4; }
body { font: 15px/1.45 system-ui, sans-serif; margin: 0; }
header.top { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; padding: .6rem 1rem; border-bottom: 1px solid var(--line); }
header.top strong { margin-right: .5rem; }
main { padding: 1rem; max-width: 76rem; margin: 0 auto; }
h1 { font-size: 1.35rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
form.stack label { display: block; margin: .6rem 0 .15rem; font-weight: 600; }
form.stack input[type=text], form.stack input[type=password], form.stack select, form.stack textarea { width: 100%; max-width: 36rem; padding: .35rem; box-sizing: border-box; }
form.stack div.hint { margin-top: .3rem; max-width: 36rem; }  /* as wide as the field above it */
form.stack div.hint + p { margin-top: 1.4rem; }
/* An input with a suggestion list (region): the list arrow always visible, not only on hover (Chromium). */
input[list]::-webkit-calendar-picker-indicator { display: block !important; opacity: 1 !important; cursor: pointer; }
.hint, .muted { color: var(--muted); font-size: .9em; }
.error { color: var(--bad); }
.notice { border: 1px solid var(--warn); padding: .4rem .7rem; margin: .6rem 0; }
.flash:empty { display: none; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.tag { border: 1px solid var(--warn); color: var(--warn); border-radius: 3px; padding: 0 .3rem; font-size: .85em; white-space: nowrap; }
.tag.link-not_found, .tag.link-not_community { border-color: var(--bad); color: var(--bad); }
.card-link { font-size: .85em; }
.card dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; }
.card dt { color: var(--muted); }
.region { color: var(--muted); font-size: .9em; font-style: italic; }
button { padding: .3rem .8rem; cursor: pointer; }
a.button { display: inline-block; padding: .3rem .8rem; border: 1px solid currentColor; border-radius: 4px; text-decoration: none; }
button.yes { border-color: var(--ok); } button.no { border-color: var(--bad); }
.inline { display: inline; margin: 0; }
.errlist { margin: .2rem 0 0; padding-left: 1.1rem; font-size: .9em; }
header.top form.logout { margin: 0 0 0 auto; }
ul.posts { list-style: none; padding: 0; margin: .6rem 0; }
ul.posts li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.post-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: .25rem; }
.posts details summary { cursor: pointer; list-style: none; }
.posts details summary .more { color: var(--muted); font-size: .9em; text-decoration: underline; }
.posts details summary .less, .posts details[open] summary .more, .posts details[open] summary .post-text { display: none; }
.posts details[open] summary .less { display: inline; color: var(--muted); font-size: .9em; text-decoration: underline; }
form.search input[type=text] { display: block; width: 100%; box-sizing: border-box; padding: .5rem .6rem; margin: 0 0 .6rem; font-size: 1.05rem; }
form.search select, form.search button { margin: 0 .4rem .6rem 0; padding: .35rem .5rem; }
form.pick { margin: .3rem 0 0; }
#picked .button { margin-right: .6rem; }
.posts mark { background: var(--mark-bg); color: var(--mark-fg); padding: 0 .1em; border-radius: 2px; }
details.near > summary { cursor: pointer; margin: .8rem 0 .2rem; }
header.top a.helplink { margin-left: auto; }
header.top form.logout { margin-left: 0; }
article.help { max-width: 46rem; line-height: 1.55; }
article.help h1 { font-size: 1.5rem; }
article.help h2 { font-size: 1.2rem; margin-top: 1.8rem; }
article.help h3 { font-size: 1.05rem; margin-top: 1.4rem; }
article.help h4 { font-size: 1rem; margin-top: 1.1rem; }
article.help ol, article.help ul { padding-left: 1.4rem; }
article.help li { margin: .25rem 0; }
article.help code { overflow-wrap: anywhere; }
article.help pre { overflow-x: auto; padding: .5rem; border: 1px solid var(--line); }
article.help table { display: block; overflow-x: auto; width: auto; max-width: 100%; }
article.help th { white-space: normal; }
fieldset { border: 1px solid var(--line); margin: .6rem 0; padding: .4rem .8rem; }
fieldset legend { font-weight: 600; }
form.stack label.inline-check { display: inline; font-weight: normal; margin: 0; }
form.stack fieldset > div { margin: .2rem 0; }
td.best { background: #1a7f3722; }
nav.tabs { margin: 1rem 0; display: flex; gap: 1rem; flex-wrap: wrap; }
nav.tabs a { padding: .45rem 1.1rem; border: 1px solid var(--muted); border-radius: 4px; text-decoration: none; }
nav.tabs a.current { font-weight: bold; border-color: currentColor; border-width: 2px; }
#flash form.inline { margin-left: .4rem; }
details.day-group { margin: .8rem 0; }
details.day-group > summary { cursor: pointer; font-weight: bold; padding: .3rem 0; }
details.day-group table, #candidates > table { table-layout: fixed; width: 100%; }
details.day-group td, #candidates > table td { overflow-wrap: anywhere; }
details.day-group th:nth-child(1), #candidates > table th:nth-child(1) { width: 14%; }
details.day-group th:nth-child(3), #candidates > table th:nth-child(3),
details.day-group th:nth-child(4), #candidates > table th:nth-child(4) { width: 6rem; }
details.day-group th:nth-child(5), #candidates > table th:nth-child(5),
details.day-group th:nth-child(6), #candidates > table th:nth-child(6) { width: 5rem; }
#candidates { overflow-x: auto; }  /* narrow screen: scroll sideways instead of squeezing */
details.day-group table, #candidates > table { min-width: 56rem; }
#candidates.settling button { opacity: .6; }

/* R1-3i: the key field of the page «Ключи». A plain text field (no password manager offers to
   save it), shown as dots where the browser can; elsewhere the text is not drawn at all. */
.secret-input { -webkit-text-security: disc; text-security: disc; font-family: monospace; }
@supports not ((-webkit-text-security: disc) or (text-security: disc)) {
  .secret-input { color: transparent; caret-color: CanvasText; text-shadow: none; }
  .secret-input::selection { color: transparent; background: #9ab; }
}
/* A39: the account in the header and the menu «Администрирование» (no script: <details>). */
header.top .who { color: var(--muted); }
header.top details.admin-menu { position: relative; }
header.top details.admin-menu summary { cursor: pointer; color: inherit; }
header.top details.admin-menu .admin-links { position: absolute; z-index: 10; display: flex; flex-direction: column; gap: .3rem; min-width: 14rem; padding: .5rem .8rem; background: Canvas; border: 1px solid var(--line); }

/* R1-6: «Все сообщества» — filter form and page links */
form.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .5rem .8rem; align-items: end; margin: .5rem 0; }
form.filters label { display: block; font-size: .9em; color: var(--muted); margin-bottom: .15rem; }
form.filters input[type=text], form.filters select { width: 100%; box-sizing: border-box; padding: .35rem .5rem; }
form.filters .filter-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; }
form.filters .filter-actions a { white-space: nowrap; }
details.list-table > summary { cursor: pointer; margin: .4rem 0; }
details.list-table > summary .more, details.list-table > summary .less { text-decoration: underline; }
details.list-table[open] > summary .more, details.list-table:not([open]) > summary .less { display: none; }
.pager a, .pager span { margin-right: .8rem; }
/* Download buttons with their own caption below each (owner's request 07.11.2026). */
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 22rem)); gap: .6rem 1.5rem; margin: .8rem 0 1rem; }
.downloads .download .hint { margin: .35rem 0 0; line-height: 1.4; }
form#users-export { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin: 1rem 0 .2rem; }
/* «Обслуживание каталога»: folded sections; the title line stays a heading with a short figure. */
details.section { border-bottom: 1px solid var(--line); padding: .2rem 0; }
details.section > summary { cursor: pointer; padding: .5rem 0; }
details.section > summary h2 { display: inline; margin: 0 .6rem 0 0; }
details.section[open] > summary { margin-bottom: .4rem; }

/* R1-6g: «+ Новая тема» is a <details> (works without a script) drawn as a button. */
details.new-topic { margin: 1rem 0; }
details.new-topic > summary.button { display: inline-block; cursor: pointer; list-style: none; padding: .3rem .8rem; border: 1px solid currentColor; border-radius: 6px; font-weight: 600; }
details.new-topic > summary.button::-webkit-details-marker { display: none; }
details.new-topic[open] > summary.button { margin-bottom: .8rem; }

/* R1-11n «Общие темы»: the path above, the tiles of a node (more of them as the tree grows). */
nav.crumbs { margin: 0 0 .4rem; color: var(--muted); }
ul.tiles { list-style: none; padding: 0; margin: .6rem 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .6rem; }
ul.tiles .tile { border: 1px solid var(--line); border-radius: 6px; }
ul.tiles .tile > a { display: flex; flex-direction: column; gap: .2rem; padding: .7rem .8rem; text-decoration: none; height: 100%; box-sizing: border-box; }
ul.tiles .tile-add, ul.tiles .tile-remove { border-style: dashed; padding: .7rem .8rem; }
ul.tiles .tile-remove > a { padding: 0; }
ul.tiles .tile-add summary { cursor: pointer; font-weight: 600; }
ul.name-hits { margin: .3rem 0 1rem; }
