/* Settings dialog shared by the hub and the match (static/hub/settings.js). Warm Monochrome: paper sheet, ink
   text, segmented choices in a sunken well with a paper tab for the selected value; no accent colour needed. */
.settings-dialog { width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--r-l);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); overflow: auto; overscroll-behavior: contain;
  font: 400 15px/1.45 var(--ui); }
.settings-dialog::backdrop { background: var(--scrim); }
.settings-dialog[open] { animation: set-in var(--t-panel) var(--ease-out); }
@keyframes set-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.set-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px 14px 24px; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.set-head h2 { margin: 0; font: 500 21px/1.3 var(--ui); }
.set-close { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-s); color: var(--ink); }
.set-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (hover: hover) { .set-close:hover { background: var(--surface-2); } }
.set-section { padding: 18px 24px 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.set-section + .set-section { border-top: 1px solid var(--line); }
.set-section h3 { margin: 0; font: 500 13px/1.3 var(--ui); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; }
.set-label { display: grid; gap: 2px; min-width: 0; }
.set-label b { font-weight: 500; }
.set-label small, .set-muted { color: var(--muted); font-size: 13px; line-height: 1.4; }
.set-muted { margin: 0; }
.set-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-s); background: var(--bg-2); }
.set-seg button { min-height: 36px; padding: 0 12px; border-radius: 3px; color: var(--muted); font-weight: 500; font-size: 14px; white-space: nowrap;
  transition: background-color var(--t-ui) ease, color var(--t-ui) ease, box-shadow var(--t-ui) ease; }
.set-seg button.on { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
@media (hover: hover) { .set-seg button:not(.on):hover { color: var(--ink); } }
.set-nick { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.set-nick .field span { font-weight: 500; }
.set-nick-row { display: flex; gap: 8px; }
.set-nick-row .input { flex: 1; min-width: 0; width: 100%; height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-s); background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2); font-size: 16px; }
.set-nick-row .input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink); }
.set-nick-row .btn { height: 44px; }
.set-nick + .set-nick { padding-top: 6px; }
.set-nick-row:has(.set-prefix) { position: relative; }
.set-prefix { position: absolute; left: 12px; top: 0; height: 44px; display: grid; place-items: center; color: var(--muted); font-size: 16px; pointer-events: none; }
.set-prefix + .input { padding-left: 28px; }
.set-nick .input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--bad); }
.set-next { display: block; margin-top: 2px; color: var(--ink); }
.set-note { margin: 0; min-height: 1.2em; font-size: 14px; font-weight: 500; }
.set-note:empty { min-height: 0; }
.set-note.ok { color: var(--good); }
.set-note.bad { color: var(--ink); padding-left: 14px; position: relative; }
/* small error text stays ink with a coloured marker (DESIGN.md, One Palette Rule) */
.set-note.bad::before { content: ''; position: absolute; left: 0; top: .45em; width: 8px; height: 8px; border-radius: 1px; background: var(--bad); }
.set-note.bad:empty::before { content: none; }

/* ---------- the settings window (settings.js, openSettings) ----------
   Sections on a second neutral layer at the left, the chosen one on paper at the right: a title with one line on
   what it holds, then short groups of rows ruled by hairlines. The window keeps one size, so switching sections
   never makes it jump; only the right side scrolls. Phones: full screen, the list of sections first (title, what is
   inside, chevron), a section opens over it with the back arrow. */
.settings-window { width: min(880px, calc(100vw - 32px)); height: min(680px, calc(100dvh - 32px)); overflow: hidden; }
.set-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); height: 100%; }
.set-nav { display: flex; flex-direction: column; min-height: 0; padding: 18px 12px; overflow: auto; background: var(--surface-2);
  box-shadow: inset -1px 0 0 var(--line); }
.set-nav-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px 16px 12px; }
.set-nav-head h2 { margin: 0; font: 500 21px/1.3 var(--ui); }
.set-nav-head .set-close { display: none; }
.set-tabs { display: grid; gap: 2px; }
.set-tab { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 0 12px; border-radius: var(--r-s);
  color: var(--muted); text-align: left; transition: background-color var(--t-ui) ease, color var(--t-ui) ease; }
/* the house marker: an outlined track cell, filled in ink for the open section */
.set-tab::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 1px; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.set-tab-text { display: grid; min-width: 0; }
.set-tab b { font-weight: 500; font-size: 15px; }
.set-tab small, .set-tab svg { display: none; }
.set-tab[aria-selected="true"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.set-tab[aria-selected="true"]::before { background: var(--ink); box-shadow: none; }
@media (hover: hover) { .set-tab[aria-selected="false"]:hover { color: var(--ink); background: var(--surface-3); } }
.set-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.set-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.set-main > .set-head { position: static; align-items: flex-start; padding: 22px 16px 18px 32px; box-shadow: none; }
.set-head-text { flex: 1; display: grid; gap: 4px; min-width: 0; }
.set-head-text h3 { margin: 0; font: 500 21px/1.3 var(--ui); }
.set-lead { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.set-back { display: none; }
.set-back, .set-close { flex: none; }
.set-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* «Сохранено» or an error for the last change, beside the title */
.set-status { margin: 10px 4px 0 0; font-size: 13px; font-weight: 500; white-space: nowrap; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.set-status:empty { display: none; }
.set-status.ok { color: var(--good); }
.set-status.bad { color: var(--ink); white-space: normal; max-width: 220px; }
.set-status.ok::before, .set-status.bad::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 1px; background: var(--good); }
.set-status.bad::before { background: var(--bad); }
.set-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 4px 32px 32px; container-type: inline-size; }
.set-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-content: start; }
.set-panel[hidden] { display: none; }
.set-group { display: grid; grid-template-columns: minmax(0, 1fr); }
.set-group h4 { margin: 0; padding-bottom: 10px; font: 500 17px/1.35 var(--ui); box-shadow: inset 0 -1px 0 var(--line); }
.set-rows { display: grid; grid-template-columns: minmax(0, 1fr); }
.set-rows > * { padding: 14px 0; }
.set-rows > * + * { box-shadow: inset 0 1px 0 var(--line); }
.set-group:first-child .set-rows > :first-child { padding-top: 6px; }
.set-group h4 + .set-rows > :first-child { padding-top: 14px; }
/* one column of choices: every segmented control in the window has the same width, its options share it */
.set-body .set-row .set-seg { display: flex; width: 320px; }
.set-body .set-row .set-seg button { flex: 1 1 auto; min-width: 0; padding: 0 10px; }
/* volume: the same width as the segmented controls; a sunken track (the segmented well's colour) filled with ink up
   to the value, a paper thumb with an ink edge like the selected tab, the number in tabular figures beside it */
.set-range-box { display: flex; align-items: center; gap: 12px; width: 320px; min-height: 42px; }
.set-range { --fill: 100%; flex: 1 1 auto; min-width: 0; height: 28px; margin: 0; background: none; cursor: pointer;
  -webkit-appearance: none; appearance: none; }
.set-range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--ink) var(--fill), var(--bg-2) var(--fill)); box-shadow: inset 0 0 0 1px var(--line); }
.set-range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); }
.set-range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--ink); }
.set-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -6px;
  border-radius: var(--r-s); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--ink), var(--shadow-1);
  transition: transform var(--t-press) var(--ease-out); }
.set-range::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: var(--r-s); background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--ink), var(--shadow-1); }
.set-range:active::-webkit-slider-thumb { transform: scale(1.08); }
.set-range:focus { outline: none; }
.set-range:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: var(--r-s); }
.set-range-value { flex: none; min-width: 4.5ch; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink); }
.set-empty { display: grid; gap: 6px; max-width: 46ch; padding: 6px 0; }
.set-empty b { font-weight: 500; }
@container (max-width: 520px) {
  .set-row { grid-template-columns: minmax(0, 1fr); }
  .set-body .set-row .set-seg, .set-range-box { width: 100%; }
  .set-body .set-row .set-seg button { padding: 0 6px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 640px) {
  .settings-window { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; inset: 0; border-radius: 0; }
  .settings-window[open] { animation: none; }
  .set-shell { grid-template-columns: minmax(0, 1fr); }
  .settings-window[data-view="nav"] .set-main, .settings-window[data-view="panel"] .set-nav { display: none; }
  .set-nav { padding: 10px 16px 24px; background: var(--surface); box-shadow: none; }
  .set-nav-head { padding: 0 0 8px 0; }
  .set-nav-head .set-close { display: grid; }
  .set-tabs { gap: 0; }
  .set-tab, .set-tab[aria-selected] { min-height: 64px; padding: 10px 0; border-radius: 0; color: var(--ink); background: none; box-shadow: none; }
  .set-tab + .set-tab { box-shadow: inset 0 1px 0 var(--line); }
  .set-tab::before { display: none; }
  .set-tab-text { flex: 1; gap: 2px; }
  .set-tab small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
  .set-tab svg { display: block; flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .set-main > .set-head { align-items: center; gap: 4px; padding: 10px 8px 10px 4px; box-shadow: 0 1px 0 var(--line); }
  .set-back { display: grid; }
  .set-head-text h3 { font-size: 19px; }
  .set-lead { display: none; }
  .set-status { margin: 0; }
  .set-body { padding: 16px 16px 32px; }
}

/* bug report form and report cards (static/hub/bugs.js) share the settings sheet */
.bug-dialog { width: min(560px, calc(100vw - 32px)); }
.bug-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.bug-reward { margin: 0; padding: 12px 14px; border-radius: var(--r-s); background: var(--bg-2); font-size: 14px; line-height: 1.45; }
.bug-reward b { font-weight: 500; }
.bug-field { display: grid; gap: 6px; }
.bug-field > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.bug-field b { font-weight: 500; }
.bug-field small { color: var(--muted); font-size: 13px; }
.bug-area { width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: var(--r-s); background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2); font: 400 15px/1.45 var(--ui); resize: vertical; user-select: text; -webkit-user-select: text; }
.bug-area:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink); }
.bug-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bug-file { font-size: 14px; color: var(--muted); max-width: 100%; }
.bug-consent { display: grid; gap: 6px; padding-top: 4px; }
.bug-check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-weight: 500; cursor: pointer; }
.bug-check input { width: 18px; height: 18px; accent-color: var(--ink); }
.bug-ctx { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.bug-ctx li { display: flex; gap: 8px; min-width: 0; }
.bug-ctx li span { flex: none; min-width: 92px; }
.bug-ctx li b { font-weight: 400; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bug-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bug-done { display: grid; gap: 12px; }
.bug-done p { margin: 0; }
.bug-card { display: grid; gap: 10px; padding: 16px 18px; margin: 0 0 12px; border-radius: var(--r-l); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.bug-card header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.bug-card header b { font-weight: 500; }
.bug-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.bug-status::before { content: ''; width: 8px; height: 8px; border-radius: 1px; background: var(--line-2); }
.s-confirmed .bug-status::before, .s-fixed .bug-status::before { background: var(--good); }
.s-rejected .bug-status::before, .s-duplicate .bug-status::before { background: var(--muted); }
.s-new .bug-status::before { background: var(--pink); }
.bug-paid { font-size: 13px; font-weight: 500; color: var(--good); }
.bug-card header small { margin-left: auto; }
.bug-card dl { margin: 0; display: grid; gap: 6px; }
.bug-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; }
.bug-row dt { color: var(--muted); font-size: 13px; }
.bug-row dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bug-note { margin: 0; padding: 10px 12px; border-radius: var(--r-s); background: var(--bg-2); font-size: 14px; }
.bug-review { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.bug-review .input { height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-s); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 15px; }
.bug-dupbox { display: inline-flex; gap: 6px; }
.bug-dup { width: 120px; }
@media (max-width: 560px) {
  .bug-pair { grid-template-columns: minmax(0, 1fr); }
  .bug-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
