/* Bootstrap 5, restyled (Р-116) — every colour a variable from theme.css.
   No colour literal here or in a template (V1 §18, rules-frontend.md). */

:root {
  --bs-body-bg: var(--sm-bg);
  --bs-body-color: var(--sm-text);
  --bs-emphasis-color: var(--sm-text);
  --bs-secondary-color: var(--sm-muted);
  --bs-tertiary-bg: var(--sm-surface);
  --bs-border-color: var(--sm-border);
  --bs-link-color: var(--sm-accent);
  --bs-link-hover-color: var(--sm-accent-hover);
  --bs-focus-ring-color: var(--sm-focus);
  --bs-body-font-size: 1rem;
}

body {
  background: var(--sm-bg);
  color: var(--sm-text);
  min-height: 100vh;
}

/* One column, a phone's width first (V1 §18). */
.sm-container {
  max-width: 30rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.sm-main {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.sm-bar {
  background: var(--sm-bg);
  border-bottom: 1px solid var(--sm-border);
}

.sm-brand {
  color: var(--sm-text);
  font-weight: 600;
}

.sm-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.sm-lead {
  color: var(--sm-muted);
  margin-bottom: 1.25rem;
}

/* Separated by a border, never a shadow — shadows do not work in the dark. */
.sm-panel {
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: 0.75rem;
  padding: 1.25rem 1rem;
}

.sm-gap {
  margin-top: 1rem;
}

/* What ends the order, or opens a case against the other person, stands apart
   from the move of the moment — a thumb's width is not enough on a phone
   (rules-frontend §3, W5a's review). */
.sm-apart {
  margin-top: 2.5rem;
}

.sm-error {
  color: var(--sm-danger);
  margin: 0.5rem 0 0;
}

/* Under a finger: 44 px at the least (V1 §18). */
.btn,
.form-control {
  min-height: 2.75rem;
}

.form-control {
  background-color: var(--sm-bg);
  border-color: var(--sm-border);
  color: var(--sm-text);
  font-size: 1rem; /* below 16 px a phone zooms in on focus */
}

.form-control:focus {
  background-color: var(--sm-bg);
  border-color: var(--sm-accent);
  box-shadow: 0 0 0 0.25rem var(--sm-focus);
  color: var(--sm-text);
}

.form-control::placeholder {
  color: var(--sm-muted);
}

.sm-code {
  font-size: 1.5rem;
  letter-spacing: 0.4em;
  text-align: center;
}

/* W6c: the platform's IBAN on «Плата за доступ». Its 29 characters in the
   login code's spacing (.sm-code) ran the page out to 893 px at 375 — found
   on the walk-through, held by test_web_support's
   test_the_fee_page_and_a_moderators_bar_fit_a_phone. Here the letters stay
   a little apart and wrap inside the panel on a narrower screen; the spacing
   is the page's, so a copy carries the IBAN as written. */
.sm-iban {
  font-weight: 600;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}

/* W7: «Перевірений виконавець» (V1 §10) — a mark in the accent's outline,
   not a filled button: it says who the person is, it is not a control. */
.sm-verified {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--sm-accent);
  border-radius: 999px;
  color: var(--sm-accent);
  font-weight: 600;
  font-size: 0.9rem;
}

/* W7: a review's stars — the accent, in the glyphs; the words beside them
   are for the screen reader (`tutors/_stars.html`). */
.sm-stars {
  color: var(--sm-accent);
  letter-spacing: 0.1em;
}

/* W7: «Новий» — neutral, the point of it (V1 §10): no colour that reads as
   good or bad. «Новий замовник» on a student reads the same. */
.sm-new {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--sm-border);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* W7: a review's five stars to choose from — five buttons in a row under a
   finger (rules-frontend §1), which fit 375 px with room to spare. */
.sm-rating {
  display: flex;
  gap: 0.5rem;
}

.sm-rating .btn {
  flex: 1 1 0;
  min-width: 0;
}

/* W7: the landing page's blocks — the restrained register, more air between
   them (rules-frontend §5); the same components as everywhere else. */
.sm-landing {
  margin-bottom: 1.75rem;
}

/* W8b10: the landing's «Як це працює» — each step numbered in a circle of
   the accent, the mockup's (docs/design/desktop/Main.dc.html); the colours
   the theme's own, so the circles read in the dark as in the light (Р-237 as
   of 24.11.2026: the landing follows the theme). The number is the list's
   own counter: a screen reader reads an ordered list. */
.sm-landing-steps {
  counter-reset: sm-step;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sm-landing-steps li {
  counter-increment: sm-step;
  display: flex;
  gap: 0.875rem;
}

.sm-landing-steps li::before {
  align-items: center;
  background: var(--sm-accent);
  border-radius: 50%;
  color: var(--sm-on-accent);
  content: counter(sm-step);
  display: inline-flex;
  flex: none;
  font-size: 0.9375rem;
  font-weight: 700;
  height: 2rem;
  justify-content: center;
  /* The circle's middle on the first line's. */
  margin-top: -0.25rem;
  width: 2rem;
}

/* W7: the counters by work type — a plain list, one line each. */
.sm-types {
  padding-left: 1.1rem;
}

/* W7, from W6c's review: a value a tutor pastes into a banking app — the
   IBAN, the amount, the purpose. Copied by its button where scripts run;
   without them a long press selects it whole. */
.sm-copyable {
  display: block;
  user-select: all;
  -webkit-user-select: all;
}

/* The four buttons (V1 §18): primary filled, secondary outlined, text, and
   red for what cannot be undone — and for nothing else. */
.btn-primary {
  --bs-btn-bg: var(--sm-accent);
  --bs-btn-border-color: var(--sm-accent);
  --bs-btn-color: var(--sm-on-accent);
  --bs-btn-hover-bg: var(--sm-accent-hover);
  --bs-btn-hover-border-color: var(--sm-accent-hover);
  --bs-btn-hover-color: var(--sm-on-accent);
  --bs-btn-active-bg: var(--sm-accent-hover);
  --bs-btn-active-border-color: var(--sm-accent-hover);
  --bs-btn-active-color: var(--sm-on-accent);
  --bs-btn-disabled-bg: var(--sm-accent);
  --bs-btn-disabled-border-color: var(--sm-accent);
  --bs-btn-disabled-color: var(--sm-on-accent);
  --bs-btn-focus-shadow-rgb: none;
}

.btn-outline-primary {
  --bs-btn-color: var(--sm-accent);
  --bs-btn-border-color: var(--sm-accent);
  --bs-btn-hover-bg: var(--sm-accent);
  --bs-btn-hover-border-color: var(--sm-accent);
  --bs-btn-hover-color: var(--sm-on-accent);
  --bs-btn-active-bg: var(--sm-accent);
  --bs-btn-active-border-color: var(--sm-accent);
  --bs-btn-active-color: var(--sm-on-accent);
}

/* A plain link in the page takes the accent too — Bootstrap's own blue is not
   a theme colour, and on the dark surface it all but disappears (found in
   W3's walk-through, on a requirement file's name). Scoped to the page: the
   bar's links keep their own colour. */
.sm-main a:not(.btn) {
  color: var(--sm-accent);
}

.sm-main a:not(.btn):hover {
  color: var(--sm-accent-hover);
}

/* W8b10: a box and a radio in the theme — the subject's list (Р-240) and the
   notices' choosing (Р-244) made them a page's main control. Bootstrap fills a
   checked one with its own blue, no theme colour, under a white mark that the
   dark theme's light accent would swallow: here the accent, the mark in the
   accent's own text colour (theme.css's images), and the edge in the muted
   colour — 3:1 against the page at the least, in both themes (WCAG 1.4.11). */
.form-check-input {
  border-color: var(--sm-muted);
}

.form-check-input:checked {
  background-color: var(--sm-accent);
  border-color: var(--sm-accent);
}

.form-check-input:checked[type="checkbox"] {
  --bs-form-check-bg-image: var(--sm-check-mark);
}

.form-check-input:checked[type="radio"] {
  --bs-form-check-bg-image: var(--sm-radio-mark);
}

.form-check-input:focus {
  border-color: var(--sm-accent);
  box-shadow: 0 0 0 0.25rem var(--sm-focus);
}

/* A fieldset's legend read as a field's label, not as a heading. */
legend.form-label {
  font-size: 1rem;
}

.btn-link {
  --bs-btn-color: var(--sm-accent);
  --bs-btn-hover-color: var(--sm-accent-hover);
  --bs-btn-active-color: var(--sm-accent-hover);
}

.btn-danger {
  --bs-btn-bg: var(--sm-danger);
  --bs-btn-border-color: var(--sm-danger);
  --bs-btn-color: var(--sm-on-danger);
  --bs-btn-hover-bg: var(--sm-danger-hover);
  --bs-btn-hover-border-color: var(--sm-danger-hover);
  --bs-btn-hover-color: var(--sm-on-danger);
  --bs-btn-active-bg: var(--sm-danger-hover);
  --bs-btn-active-border-color: var(--sm-danger-hover);
  --bs-btn-active-color: var(--sm-on-danger);
}

.btn:focus-visible {
  box-shadow: 0 0 0 0.25rem var(--sm-focus);
}

/* On a phone the bar is two rows by design: the brand and the menu, then the
   daily sections as tabs — three links and a button do not fit 375 px in one.
   From 576 px they share one row. */
.sm-bar .sm-container {
  flex-wrap: wrap;
}

/* W6c: a moderator's tabs are four and the bell, and since #34 the bell
   carries a count — at 1.25rem apart the count ran past a 375 px screen's
   edge (found on the walk-through; test_web_support's
   test_the_fee_page_and_a_moderators_bar_fit_a_phone). On a phone the tabs
   sit 1rem apart, and if a row still does not fit — a chat's count beside the
   bell's — the bell wraps rather than run off the screen. From 576 px, as
   before. */
.sm-bar-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1rem;
  order: 3;
  width: 100%;
}

.sm-menu-button {
  order: 2;
  margin-left: auto;
}

@media (min-width: 576px) {
  .sm-bar-links {
    order: 0;
    width: auto;
    flex-wrap: nowrap;
    column-gap: 1.25rem;
    margin-left: auto;
    margin-right: 0.75rem;
  }

  .sm-menu-button {
    margin-left: 0;
  }
}

.sm-bar-link {
  color: var(--sm-text);
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.sm-bar-link:hover,
.sm-bar-link:focus-visible {
  color: var(--sm-accent);
}

.sm-card {
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.sm-card h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.sm-state {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.sm-muted {
  color: var(--sm-muted);
}

.sm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.sm-row > form {
  flex: 1 1 10rem;
}

.sm-section {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
}

.sm-notice {
  background: var(--sm-surface);
  border: 1px solid var(--sm-danger);
  border-radius: 0.75rem;
  color: var(--sm-text);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.sm-file {
  border: 1px solid var(--sm-border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  /* W8b4: a file's name with no place to break at ran the wizard out to
     1179 px at 375 — `anywhere`, unlike `break-word`, shrinks the line's
     smallest width too, so a flex row of name and «Прибрати» wraps. */
  overflow-wrap: anywhere;
}

.sm-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.form-select {
  background-color: var(--sm-bg);
  border-color: var(--sm-border);
  color: var(--sm-text);
  font-size: 1rem;
  min-height: 2.75rem;
}

.sm-menu-button {
  border: 1px solid var(--sm-border);
  min-width: 2.75rem;
}

/* W8b8 (Р-237): the theme's switch, beside the menu — in the first row on a
   phone, after the tabs from 576 px. A moon while the page is dark, a sun
   while it is light: both buttons are in the form, and the one for the
   theme the page is in shows — the phone's own included, by the same media
   query the colours use — so the press needs neither a script nor the
   server's guess. */
.sm-theme {
  display: flex;
  margin-left: auto;
  order: 2;
}

.sm-theme + .sm-menu-button {
  margin-left: 0.5rem;
}

@media (min-width: 576px) {
  .sm-theme {
    margin-left: 0;
  }
}

.sm-theme .sm-theme-button {
  align-items: center;
  border: 1px solid var(--sm-border);
  color: var(--sm-text);
  justify-content: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
}

.sm-theme .sm-theme-to-dark {
  display: inline-flex;
}

.sm-theme .sm-theme-to-light {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-sm-theme="light"]) .sm-theme .sm-theme-to-dark {
    display: none;
  }

  :root:not([data-sm-theme="light"]) .sm-theme .sm-theme-to-light {
    display: inline-flex;
  }
}

:root[data-sm-theme="dark"] .sm-theme .sm-theme-to-dark {
  display: none;
}

:root[data-sm-theme="dark"] .sm-theme .sm-theme-to-light {
  display: inline-flex;
}

/* W8b12 (Р-248): admin.'s bar — «Вийти» where the site's menu stands: beside
   the switch, on the right, in the first row on a phone. Without a place of
   its own the form came first, between the brand and the tabs. */
.sm-signout {
  margin-left: 0.5rem;
  order: 2;
}

/* W8b10 (Р-237 as of 24.11.2026): a guest's bar — the switch beside «Увійти»,
   on the right at every width. The pair is one box, so the switch is never
   put after «Увійти» by its own order. */
.sm-guest {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.sm-guest .sm-theme {
  margin-left: 0;
  order: 0;
}

.sm-menu {
  background: var(--sm-bg);
  color: var(--sm-text);
}

/* The hamburger drawn from the text colour: Bootstrap's toggler icon is an SVG
   with a fixed dark stroke, invisible in the dark theme. */
.sm-burger,
.sm-burger::before,
.sm-burger::after {
  background: var(--sm-text);
  border-radius: 1px;
  display: block;
  height: 2px;
  width: 1.25rem;
}

.sm-burger {
  position: relative;
}

.sm-burger::before,
.sm-burger::after {
  content: "";
  left: 0;
  position: absolute;
}

.sm-burger::before {
  top: -6px;
}

.sm-burger::after {
  top: 6px;
}

/* The bell (V1 §18, W4): an icon drawn from the text colour, and the unread
   count on it. */
.sm-bell {
  position: relative;
  padding: 0 0.25rem;
}

.sm-badge {
  background: var(--sm-accent);
  border-radius: 1rem;
  color: var(--sm-on-accent);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  min-width: 1.25rem;
  padding: 0.2rem 0.35rem;
  position: absolute;
  right: -0.4rem;
  text-align: center;
  top: 0.2rem;
}

/* The payment screen (V1 §18) — the restrained register: more air. The 30
   minutes are the sharpest deadline in the system and look unlike the rest
   (V1 §14): an accent border, the time in bold. */
.sm-deadline {
  border: 2px solid var(--sm-accent);
  border-radius: 0.75rem;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
}

.sm-facts dt {
  color: var(--sm-muted);
  font-weight: 400;
  margin-top: 0.75rem;
}

.sm-facts dd {
  margin-bottom: 0;
}

.sm-amount {
  font-size: 1.5rem;
  font-weight: 600;
}

/* The card number: large, in fixed-width digits, selected whole by one long
   press on a phone — and copied by the button beside it where scripts run. */
.sm-card-number {
  display: block;
  font-family: var(--bs-font-monospace);
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  user-select: all;
  -webkit-user-select: all;
}

.sm-steps {
  padding-left: 1.25rem;
}

.sm-steps li {
  margin-bottom: 0.35rem;
}

/* The tab: each notice a full-width button — clicking it is what reads it
   (V1 §18) — and the unread ones in bold with a mark. */
.sm-notice-item {
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: 0.75rem;
  color: var(--sm-text);
  display: block;
  margin-bottom: 0.5rem;
  padding: 0.75rem 1rem;
  text-align: left;
  width: 100%;
}

.sm-notice-item:hover,
.sm-notice-item:focus-visible {
  border-color: var(--sm-accent);
}

.sm-notice-item.sm-unread {
  border-left: 4px solid var(--sm-accent);
  font-weight: 600;
}

.sm-notice-item .sm-muted {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  margin-top: 0.25rem;
}

/* Bootstrap's close button is a black glyph; in the dark it is turned light,
   as Bootstrap's own dark mode does — the phone's dark until the switch
   chooses light, and the switch's dark (W8b8, Р-237). */
@media (prefers-color-scheme: dark) {
  :root:not([data-sm-theme="light"]) .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
  }
}

:root[data-sm-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* The file picker (W4's review, `templates/_file_picker.html`): the label is
   the button, in the page's words, once `files.js` has run; until then — and
   with scripts off — the browser's own control is the one shown. The input is
   hidden visually, never removed: it stays in the form, focusable, and the
   button shows its focus. */
.sm-file-picker {
  position: relative;
}

.sm-file-picker .sm-file-button {
  display: none;
}

.sm-file-picker.sm-enhanced .sm-file-button {
  display: block;
}

.sm-file-picker.sm-enhanced .sm-file-input {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.sm-file-picker.sm-enhanced:focus-within .sm-file-button {
  box-shadow: 0 0 0 0.25rem var(--sm-focus);
}

/* W8b4: a file dragged over the picker — the field says it will take it. */
.sm-file-picker.sm-drop .sm-file-button {
  border-style: dashed;
  box-shadow: 0 0 0 0.25rem var(--sm-focus);
}

.sm-file-chosen {
  margin-top: 0.5rem;
  overflow-wrap: anywhere;
}

/* W8b5 (12.1): the files a picker of several keeps, each with its
   «Прибрати» — the name wraps, the button stays under a finger. */
.sm-file-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.sm-file-list li {
  align-items: center;
  border-bottom: 1px solid var(--sm-border);
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.sm-file-list li span {
  overflow-wrap: anywhere;
}

.sm-file-list .sm-file-remove {
  flex: none;
}

/* W8b5 (V1 §15): an upload's bar, in the accent, the percent beside it. */
.sm-progress {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.sm-progress progress {
  accent-color: var(--sm-accent);
  flex: 1 1 auto;
  height: 0.75rem;
  min-width: 0;
}

.sm-progress span {
  flex: none;
}

/* The chat (W5a). A message is a bordered block — the dark theme separates by
   a border, never a shadow (rules-frontend §2); one's own sits on the
   surface tone. A file is a row a finger can hit: its name, then its type and
   size, before the download (V1 §15). */
.sm-chat {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.sm-message {
  border: 1px solid var(--sm-border);
  border-radius: 0.75rem;
  padding: 0.625rem 0.875rem;
  max-width: 92%;
}

.sm-message.sm-mine {
  align-self: flex-end;
  background: var(--sm-surface);
}

.sm-message-head {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.sm-message-body {
  margin-bottom: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sm-attachment {
  border-top: 1px solid var(--sm-border);
  display: block;
  margin-top: 0.5rem;
  min-height: 44px;
  padding-top: 0.5rem;
}

.sm-attachment-name {
  display: block;
  overflow-wrap: anywhere;
}

.sm-attachment .sm-muted {
  display: block;
  font-size: 0.875rem;
  /* W8b6: «збережеться як …py.txt» repeats a code file's name, and a name
     with no place to break at ran the chat out to 987 px at 375. */
  overflow-wrap: anywhere;
}

.sm-chat-card {
  color: inherit;
  display: block;
  text-decoration: none;
}

.sm-chat-card .sm-muted {
  display: block;
  font-size: 0.875rem;
}

.sm-chat-card-title {
  display: block;
  font-weight: 600;
}

.sm-badge.sm-badge-inline {
  margin-left: 0.35rem;
  position: static;
  vertical-align: middle;
}

/* W6a — Р-230. The warning before a message that looks like a contact is
   sent: a caution, in the sender's own chat, not an error. */
.sm-caution {
  background: var(--sm-surface);
  border: 1px solid var(--sm-warning);
  border-radius: 0.75rem;
  color: var(--sm-text);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

/* The same message as the moderator sees it on the case page: flagged. */
.sm-flagged {
  border-left: 3px solid var(--sm-warning);
}

.sm-flag {
  color: var(--sm-warning);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

/* W8b (Р-233): the closed test's line, on every page above the bar — the
   caution colour, the page's own background for its text, so it reads in
   both themes. */
.sm-test-mode {
  background: var(--sm-warning);
  color: var(--sm-bg);
  font-weight: 600;
  padding: 0.5rem 1rem;
  text-align: center;
}

/* --- W8b10 (Р-240; V1 §9): the subject chosen from the whole catalogue — a
   scrolling box under the filter, on a phone no taller than 18rem; each row
   under a finger, the whole row the label's. The chosen ones on top, a line
   under them. --- */
.sm-subjects {
  margin: 0;
}

.sm-subject-filter .form-control {
  margin-bottom: 0.25rem;
}

.sm-subject-found {
  font-size: 0.875rem;
  margin: 0 0 0.25rem;
  min-height: 1.3125rem;
}

.sm-subject-list {
  border: 1px solid var(--sm-border);
  border-radius: 0.5rem;
  max-height: 18rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.25rem 0;
}

.sm-subject-list .form-check {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  margin: 0;
  min-height: 2.75rem;
  padding: 0 0.75rem;
}

.sm-subject-list .form-check-input {
  flex: none;
  float: none;
  margin: 0;
}

.sm-subject-list .form-check-label {
  align-self: stretch;
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 0.5rem 0;
}

.sm-subject-chosen + .form-check:not(.sm-subject-chosen) {
  border-top: 1px solid var(--sm-border);
}

.sm-subject-none {
  margin-top: 0.75rem;
}

/* --- W8b10 (Р-241, Р-243): chips — the notices' kinds and «Історія»'s two: a
   row of links under a finger, the one shown filled with the accent, each
   with its count; a row that does not fit a phone wraps. --- */
.sm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sm-main a.sm-chip {
  align-items: center;
  border: 1px solid var(--sm-border);
  border-radius: 999px;
  color: var(--sm-text);
  display: inline-flex;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  text-decoration: none;
}

.sm-main a.sm-chip:hover,
.sm-main a.sm-chip:focus-visible {
  border-color: var(--sm-accent);
  color: var(--sm-text);
}

.sm-main a.sm-chip[aria-current="page"] {
  background: var(--sm-accent);
  border-color: var(--sm-accent);
  color: var(--sm-on-accent);
  font-weight: 600;
}

.sm-chip-count {
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  min-width: 1.5rem;
  padding: 0.2rem 0.4rem;
  text-align: center;
}

/* --- W8b11 (Р-245): the moderation home's chips — on a phone one row a finger
   scrolls sideways, every chip whole on it (`chips.js` brings the current one
   into view); from 992 px they wrap, as the notices' do at every width (the
   desktop's query). The padding keeps a chip's focus inside the row's box;
   `position` makes the row the box of what is placed absolutely in it — a
   count's words for a screen reader (`.visually-hidden`) stood past a phone's
   edge, out of the row's scroll, and ran the page 535 px wide at 375. --- */
.sm-chips-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0.25rem 0.125rem;
  position: relative;
}

.sm-chips-scroll > .sm-chip {
  flex: none;
  white-space: nowrap;
}

/* A card's queue in «Усі» (Р-245) — over its title, quiet. */
.sm-card-queue {
  color: var(--sm-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* --- W8b10 (Р-242; V1 §18 «Комп'ютер»): a list's card — the request and its
   price, whose move and the term, the action; the same card on a phone and
   a computer, in place of W8b9's table. The columns are the desktop's query
   (`.sm-deck`). --- */
.sm-item {
  display: flex;
  flex-direction: column;
}

.sm-item-line {
  align-items: baseline;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.sm-item-what,
.sm-item-move {
  min-width: 0;
}

.sm-card .sm-item-title {
  margin-bottom: 0.25rem;
  overflow-wrap: anywhere;
}

.sm-item-when {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.sm-item-price {
  flex: none;
  font-weight: 600;
  white-space: nowrap;
}

.sm-item-term {
  color: var(--sm-muted);
  flex: none;
  white-space: nowrap;
}

.sm-item-move > :last-child {
  margin-bottom: 0;
}

/* The action at the card's foot: a card stretched beside a taller one in its
   row keeps its button at the bottom; alone, nothing to take. */
.sm-item-act {
  margin-top: auto;
  padding-top: 0.75rem;
}

.sm-row.sm-item-act {
  margin-top: auto;
}

/* --- W8b10 (Р-244): the notices deleted — «Позначити всі прочитаними» and
   the bin in one row; in the choosing, a box left of each notice, a finger's
   width and height, and «Вибрати всі (N)» above. --- */
.sm-tab-actions {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sm-tab-actions > form {
  flex: 1 1 auto;
}

.sm-tab-actions .sm-bin {
  align-items: center;
  border: 1px solid var(--sm-border);
  color: var(--sm-text);
  display: inline-flex;
  flex: none;
  justify-content: center;
  margin-left: auto;
  min-height: 2.75rem;
  min-width: 2.75rem;
}

.sm-tab-actions .sm-bin:hover,
.sm-tab-actions .sm-bin:focus-visible {
  border-color: var(--sm-accent);
  color: var(--sm-accent);
}

.sm-notice-row {
  align-items: stretch;
  display: flex;
  gap: 0.25rem;
}

.sm-notice-row > form {
  flex: 1 1 auto;
  min-width: 0;
}

.sm-pick {
  align-items: center;
  cursor: pointer;
  display: flex;
  flex: none;
  justify-content: center;
  margin-bottom: 0.5rem;
  min-height: 2.75rem;
  min-width: 2.75rem;
}

.sm-pick .form-check-input,
.sm-all .form-check-input {
  float: none;
  height: 1.375rem;
  margin: 0;
  width: 1.375rem;
}

.sm-all {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  margin: 0;
  min-height: 2.75rem;
  padding: 0;
}

.sm-choose .sm-row {
  margin-top: 0.5rem;
}

/* A history's card is quieter (Р-242): the page's own background, the state
   in the plain weight and the muted colour. */
.sm-item.sm-quiet {
  background: var(--sm-bg);
}

.sm-quiet .sm-state {
  color: var(--sm-muted);
  font-weight: 400;
}

/* ============================================================================
   W8b9 (Р-239; V1 §18 «Комп'ютер»; the owner's mockups, docs/design/desktop/).
   One markup and one breakpoint: from 992 px the desktop layout, and below it
   nothing changes — the rules outside the media query below only hide what a
   computer alone shows (the walk-through compares the phone's pages pixel for
   pixel before and after). Colours are theme.css's variables; nothing waits
   on a hover.
   ========================================================================= */

/* What a computer alone shows, and what a phone alone. */
@media (max-width: 991.98px) {
  .sm-wide-only,
  .sm-account {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .sm-narrow-only {
    display: none !important;
  }

  /* The container to 1200 px, the bar's and the page's alike. */
  .sm-container {
    max-width: 75rem;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .sm-main {
    padding-top: 2.5rem;
    padding-bottom: 5rem;
  }

  .sm-title {
    font-size: 2rem;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
  }

  /* A form, a window, a letter: no wider than reading needs (V1 §18). */
  .sm-narrow {
    max-width: 42rem;
  }

  /* A page's first action under its title — a button, not the page's width. */
  .sm-lead-action {
    min-width: 14rem;
    width: auto !important;
  }

  /* --- The bar: one row. The sections on the left, the theme, the bell and
     «Акаунт» on the right; the hamburger is the phone's. The tabs' box is
     undone so the bell can stand among the right-hand three. --- */
  .sm-bar {
    padding-bottom: 0;
    padding-top: 0;
  }

  .sm-bar .sm-container {
    column-gap: 0.25rem;
    flex-wrap: nowrap;
    min-height: 4rem;
  }

  .sm-brand {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-right: 1.25rem;
  }

  .sm-bar-links {
    display: contents;
  }

  .sm-bar-link {
    align-self: stretch;
    border-bottom: 3px solid transparent;
    border-top: 3px solid transparent;
    font-weight: 500;
    min-height: 4rem;
    order: 1;
    padding: 0 0.875rem;
  }

  .sm-bar-link[aria-current="page"] {
    border-bottom-color: var(--sm-accent);
    color: var(--sm-accent);
    font-weight: 600;
  }

  .sm-theme {
    margin-left: auto;
    order: 2;
  }

  .sm-theme .sm-theme-button {
    border-color: transparent;
  }

  .sm-bar-link.sm-bell {
    align-self: center;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    justify-content: center;
    min-height: 2.75rem;
    min-width: 2.75rem;
    order: 3;
    padding: 0;
  }

  .sm-bar-link.sm-bell[aria-current="page"] {
    border-color: var(--sm-accent);
  }

  .sm-menu-button {
    display: none;
  }

  /* «Акаунт» and its menu — a disclosure: <summary> is the button. */
  .sm-account {
    margin-left: 0.5rem;
    order: 4;
    position: relative;
  }

  .sm-account-button {
    align-items: center;
    border: 1px solid var(--sm-border);
    border-radius: 999px;
    color: var(--sm-text);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.9375rem;
    font-weight: 600;
    gap: 0.5rem;
    list-style: none;
    min-height: 2.75rem;
    padding: 0 0.75rem 0 0.375rem;
    user-select: none;
  }

  .sm-account-button::-webkit-details-marker {
    display: none;
  }

  .sm-account-button:focus-visible {
    box-shadow: 0 0 0 0.25rem var(--sm-focus);
    outline: 0;
  }

  .sm-account-button[aria-current="page"],
  .sm-account[open] > .sm-account-button {
    border-color: var(--sm-accent);
    color: var(--sm-accent);
  }

  .sm-account-icon {
    align-items: center;
    background: var(--sm-surface);
    border-radius: 50%;
    display: inline-flex;
    height: 2rem;
    justify-content: center;
    width: 2rem;
  }

  .sm-account[open] .sm-account-chevron {
    transform: rotate(180deg);
  }

  /* No shadow: the dark theme separates by a border (rules-frontend §2). */
  .sm-account-menu {
    background: var(--sm-bg);
    border: 1px solid var(--sm-border);
    border-radius: 0.75rem;
    min-width: 16rem;
    padding: 0.5rem 0;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 1040;
  }

  .sm-account-item {
    align-items: center;
    background: none;
    border: 0;
    color: var(--sm-text);
    display: flex;
    font-size: 1rem;
    min-height: 2.75rem;
    padding: 0 1rem;
    text-align: left;
    text-decoration: none;
    width: 100%;
  }

  .sm-account-item:hover,
  .sm-account-item:focus-visible {
    background: var(--sm-surface);
    color: var(--sm-accent);
    outline: 0;
  }

  .sm-account-out {
    border-top: 1px solid var(--sm-border);
    margin-top: 0.25rem;
    padding-top: 0.25rem;
  }

  /* --- Two columns: the content and, beside it, the move of the moment
     (the order pages), the side's panels («Роботи»), the points («Акаунт»).
     The side spans every row the content takes, the last row flexible, so
     a side taller than the content never spreads the content apart. --- */
  .sm-split {
    align-items: start;
    column-gap: 2rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 23rem;
    grid-template-rows: repeat(8, auto) 1fr;
    margin-top: 1.5rem;
  }

  /* In the wide column a button keeps a button's width; the side's stay
     whole, a phone's width. */
  .sm-split > .sm-panel .btn.w-100,
  .sm-split-main .btn.w-100 {
    min-width: 16rem;
    width: auto !important;
  }

  .sm-split > * {
    grid-column: 1;
  }

  .sm-split > .sm-split-side {
    grid-column: 2;
    grid-row: 1 / -1;
  }

  .sm-split-main > :first-child,
  .sm-split-side > :first-child,
  .sm-split > :first-child {
    margin-top: 0;
  }

  /* The content's text keeps a line a reader can follow. */
  .sm-split .sm-description {
    max-width: 46rem;
  }

  /* --- W8b10 (Р-242): the lists as cards left to right — «Мої заявки»,
     «Роботи», the offers, «Історія» — two columns from 992 px, three from
     1200 (below). Beside a side (`.sm-split-main`) a column fewer — the
     main column is the page's less the side: one, then two; the side's
     own deck (the offers) one. Cards of a row stand as tall as the
     tallest, the action at each one's foot. --- */
  .sm-deck {
    align-items: stretch;
    column-gap: 1rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sm-deck > .sm-card {
    margin-bottom: 1rem;
  }

  .sm-split-main .sm-deck,
  .sm-split-side .sm-deck {
    grid-template-columns: minmax(0, 1fr);
  }

  /* A card's button is the card's width, wherever the card stands — the
     wide column's own rule keeps a lone button to a button's width. */
  .sm-split-main .sm-deck .btn.w-100 {
    min-width: 0;
    width: 100% !important;
  }

  /* --- Cards in a grid: the feed in two columns. --- */
  .sm-cards {
    column-gap: 1rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sm-cards > .sm-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
  }

  .sm-cards > .sm-card > form:last-child,
  .sm-cards > .sm-card > .btn:last-child {
    margin-top: auto;
  }

  /* W8b11 (Р-245): the moderation's chips wrap — a computer has the width
     (W8b9's queues side by side and their pages' grids went with the old
     home: its cards are the lists' deck now, Р-242). */
  .sm-chips-scroll {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  /* On a wide page a button standing alone keeps a button's width. */
  .sm-page:not(.sm-narrow) > .btn.w-100 {
    min-width: 16rem;
    width: auto !important;
  }

  .sm-search {
    max-width: 42rem;
  }

  /* The field and «Відкрити» in one row — a computer has the width (on a
     phone the field's full width wraps the button under it, W8b5's trap). */
  .sm-search .form-control {
    flex: 1 1 16rem;
    width: auto;
  }

  /* --- The chats: a list beside the conversation, as a messenger. --- */
  .sm-chats {
    border: 1px solid var(--sm-border);
    border-radius: 0.875rem;
    display: grid;
    grid-template-columns: minmax(16rem, 21rem) minmax(0, 1fr);
    min-height: 36rem;
    overflow: hidden;
  }

  .sm-chats-list {
    border-right: 1px solid var(--sm-border);
    padding: 1.25rem 0.75rem;
  }

  .sm-chats-list > :first-child {
    margin-top: 0;
  }

  .sm-chats-list .sm-section {
    color: var(--sm-muted);
    font-size: 0.875rem;
    margin: 1rem 0.5rem 0.5rem;
  }

  .sm-chats-list .sm-title {
    font-size: 1.375rem;
    margin: 0 0.5rem 0.5rem;
  }

  .sm-chats-list .sm-chat-card {
    background: var(--sm-bg);
    border-color: transparent;
    margin-bottom: 0.25rem;
  }

  .sm-chats-list .sm-chat-card[aria-current="page"] {
    background: var(--sm-surface);
    border-color: var(--sm-border);
  }

  .sm-chats-list .sm-chat-card:hover,
  .sm-chats-list .sm-chat-card:focus-visible {
    border-color: var(--sm-accent);
  }

  .sm-chats-talk {
    padding: 1.25rem 1.5rem 1.5rem;
  }

  .sm-chats-talk > :first-child {
    margin-top: 0;
  }

  .sm-chats-talk .sm-message {
    max-width: 72%;
  }

  /* The composer's buttons a button's width, «Надіслати» on the right. */
  .sm-chats-talk .sm-file-button,
  .sm-chats-talk form .btn.w-100 {
    max-width: 20rem;
  }

  .sm-chats-talk form > .btn-primary.w-100 {
    display: block;
    margin-left: auto;
  }

  .sm-chats-none {
    align-items: center;
    color: var(--sm-muted);
    display: flex;
    justify-content: center;
    padding: 2rem;
  }

  /* --- A case: the order, the parties and the timeline; the evidence; the
     decision — three columns. «Взяти в роботу» stands first in the page and
     at the head of the decision's column. --- */
  .sm-case {
    align-items: start;
    column-gap: 1.5rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto 1fr;
    margin-top: 1.5rem;
  }

  .sm-case-facts {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .sm-case-proof {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .sm-case-take {
    grid-column: 3;
    grid-row: 1;
  }

  .sm-case-decide {
    grid-column: 3;
    grid-row: 2;
  }

  .sm-case > * > :first-child {
    margin-top: 0;
  }

  .sm-case-take + .sm-case-facts ~ .sm-case-decide > :first-child {
    margin-top: 1rem;
  }

  /* --- The landing (V1 §18): who we are beside «Як це працює», three cards
     below, «Увійти» at the foot. --- */
  .sm-landing-page {
    column-gap: 2rem;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    row-gap: 3.5rem;
  }

  .sm-landing-page > .sm-landing {
    margin: 0;
  }

  .sm-landing-who {
    align-self: center;
    grid-column: span 3;
  }

  .sm-landing-who .sm-title {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1.25rem;
  }

  .sm-landing-who .sm-lead {
    font-size: 1.1875rem;
    line-height: 1.6;
    margin-bottom: 0;
  }

  .sm-landing-how {
    background: var(--sm-surface);
    border: 1px solid var(--sm-border);
    border-radius: 0.75rem;
    grid-column: span 3;
    padding: 1.75rem;
  }

  .sm-landing-how .sm-section {
    margin-top: 0;
  }

  .sm-landing-card {
    border: 1px solid var(--sm-border);
    border-radius: 0.75rem;
    grid-column: span 2;
    padding: 1.5rem;
  }

  .sm-landing-card .sm-section {
    margin-top: 0;
  }

  .sm-landing-go {
    align-items: center;
    display: flex;
    flex-direction: column;
    grid-column: 1 / -1;
  }

  .sm-landing-go > .btn {
    max-width: 22rem;
  }
}

/* W8b10 (Р-242): from 1200 px the lists' cards three a row — beside a side,
   two. A computer's alone, as the query above. */
@media (min-width: 1200px) {
  .sm-deck {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sm-split-main .sm-deck {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
