/* Редизайн кабінету «Термінал» (IFMT-6925, інкремент 1): базові компоненти — кнопки, бейджі, сповіщення, перемикач,
   меню, аватар і логотип, бічна панель (drawer), діалог, тости.
   Джерело — еталон prototype v7.10, assets/app.css і themes.css; класи ті самі, що в еталоні, щоб CSS звірявся без перекладу.
   Область дії — лише елементи всередині .rd (шапка, бічне меню, нові екрани, тости, діалоги): старі сторінки
   (Bootstrap .btn, Radzen) у .rd-legacy цих правил не отримують. Звідси префікс .rd: він же перебиває Bootstrap,
   який має ті самі назви класів (.btn, .badge, .toast) і підключений раніше.
   rem — еталон × 1,6 (корінь кабінету 10px), див. tokens.css. */

/* ——— Основа області .rd ——— */
.rd,
.rd *,
.rd *::before,
.rd *::after {
  box-sizing: border-box;
}

.rd {
  font-family: var(--font);
  font-size: var(--t-m);
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

.rd [hidden] {
  display: none !important;
}

.rd ::selection {
  background: var(--sel-bg);
  color: var(--ink);
}

.rd img,
.rd svg {
  display: block;
}

.rd a {
  color: var(--action);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.rd a:hover {
  color: var(--action-hover);
}

.rd :focus {
  outline: none;
}

.rd :focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--r-s);
}

.rd h1,
.rd h2,
.rd h3,
.rd h4 {
  margin: 0;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.01em;
  text-wrap: balance;
  color: inherit;
  font-family: var(--font);
}

.rd h1 {
  font-size: var(--t-3xl);
  letter-spacing: -.02em;
}

.rd h2 {
  font-size: var(--t-xl);
}

.rd h3 {
  font-size: var(--t-l);
}

.rd p {
  margin: 0;
}

.rd ul,
.rd ol {
  margin: 0;
}

.rd button {
  font-family: var(--font);
}

.rd .muted {
  color: var(--ink-3);
}

.rd .small {
  font-size: var(--t-s);
}

.rd .xs {
  font-size: var(--t-xs);
}

.rd .num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rd .cell-sub {
  display: block;
  font-size: var(--t-s);
  color: var(--ink-3);
}

.rd .visually-hidden,
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.rd .icon {
  width: 2rem;
  height: 2rem;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rd .icon-s {
  width: 1.6rem;
  height: 1.6rem;
}

.rd .icon-inline {
  display: inline;
  vertical-align: -3px;
  margin-right: .4rem;
}

/* ——— Кнопки ——— */
.rd .btn {
  --bg: var(--surface);
  --fg: var(--ink);
  --bd: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  min-height: 4rem;
  padding: 0 1.6rem;
  font: 500 var(--t-m)/1 var(--font);
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: var(--r-m);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}

.rd .btn:hover {
  --bg: var(--canvas);
  color: var(--fg);
  background: var(--bg);
  border-color: var(--bd);
}

/* Bootstrap перебиває :active (селектор :not(.btn-check)+.btn:active) — повертаємо власні змінні */
.rd .btn:active,
.rd .btn.active {
  transform: translateY(1px);
  color: var(--fg);
  background: var(--bg);
  border-color: var(--bd);
}

.rd .btn[disabled],
.rd .btn[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.rd .btn-primary {
  --bg: var(--action);
  --fg: var(--on-accent);
  --bd: var(--action);
}

.rd .btn-primary:hover {
  --bg: var(--action-hover);
  --bd: var(--action-hover);
}

.rd .btn-primary:active {
  --bg: var(--action-press);
}

.rd .btn-danger {
  --bg: var(--danger-bg);
  --fg: var(--on-danger);
  --bd: var(--danger-bg);
}

.rd .btn-danger:hover {
  --bg: var(--danger-bg-hover);
  --bd: var(--danger-bg-hover);
}

.rd .btn-ghost {
  --bd: transparent;
  --bg: transparent;
}

.rd .btn-ghost:hover {
  --bg: var(--canvas);
}

.rd .btn-s {
  min-height: 3.2rem;
  padding: 0 1.2rem;
  font-size: var(--t-s);
  border-radius: var(--r-s);
}

.rd .btn-l {
  min-height: 4.8rem;
  padding: 0 2.2rem;
  font-size: var(--t-l);
}

.rd .btn-icon {
  width: 4rem;
  padding: 0;
}

.rd .btn .btn-label {
  display: none;
}

.rd .btn .spinner {
  width: 1.6rem;
  height: 1.6rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: rd-spin .7s linear infinite;
}

@keyframes rd-spin {
  to {
    transform: rotate(360deg);
  }
}

.rd .link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--action);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.rd .link-btn:hover {
  color: var(--action-hover);
}

.rd .link-btn[disabled] {
  color: var(--ink-3);
  text-decoration: none;
  cursor: default;
}

/* ——— Поле пошуку (меню компаній) ——— */
.rd input[type="search"],
.rd input[type="text"] {
  width: 100%;
  min-height: 4.4rem;
  padding: 1rem 1.2rem;
  font: 400 var(--t-m)/1.3 var(--font);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--field-border);
  border-radius: var(--r-m);
  caret-color: var(--action);
  transition: border-color .15s, box-shadow .15s;
}

.rd input::placeholder {
  color: var(--placeholder);
}

.rd input:hover {
  border-color: var(--ink-3);
}

.rd input:focus-visible {
  outline: none;
  border-color: var(--action);
  box-shadow: 0 0 0 3px rgba(47, 122, 22, .2);
  border-radius: var(--r-m);
}

/* ——— Перемикач: справжня кнопка role=switch ——— */
.rd .switch {
  position: relative;
  width: 4.4rem;
  height: 2.6rem;
  flex: none;
  border-radius: 13px;
  border: 0;
  padding: 0;
  background: var(--ink-4);
  box-shadow: inset 0 0 0 1px var(--ink-3);
  cursor: pointer;
  transition: background-color .2s var(--ease);
}

.rd .switch:focus-visible {
  box-shadow: inset 0 0 0 1px var(--ink-3), var(--focus);
  border-radius: 13px;
}

.rd .switch::after {
  content: "";
  position: absolute;
  top: .3rem;
  left: .3rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform .2s var(--ease);
}

.rd .switch[aria-checked="true"] {
  background: var(--action);
  box-shadow: none;
}

.rd .switch[aria-checked="true"]:focus-visible {
  box-shadow: var(--focus);
}

.rd .switch[aria-checked="true"]::after {
  transform: translateX(1.8rem);
}

.rd .switch[aria-busy="true"] {
  opacity: .6;
  cursor: progress;
}

.rd .switch:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.rd .switch-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.rd .switch-state {
  font-size: var(--t-s);
  color: var(--ink-3);
  min-width: 3.5em;
}

/* ——— Бейджі ——— */
.rd .badge {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .3rem 1rem .3rem .8rem;
  border-radius: 999px;
  font-size: var(--t-s);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--panel);
  color: var(--ink-2);
  vertical-align: baseline;
}

.rd .badge .dot {
  width: .8rem;
  height: .8rem;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.rd .badge-ok {
  background: var(--brand-soft);
  color: var(--ok-text);
}

.rd .badge-ok .dot {
  background: var(--action);
}

.rd .badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.rd .badge-warn .dot {
  background: var(--warn-mark);
}

.rd .badge-bad {
  background: var(--danger-soft);
  color: var(--danger);
}

.rd .badge-info {
  background: var(--info-soft);
  color: var(--info);
}

.rd .badge-muted {
  background: var(--panel);
  color: var(--ink-3);
}

/* ——— Сповіщення: червоне — блокує роботу, жовте — потрібна дія, решта — нейтрально ——— */
.rd .notice {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  padding: 1.4rem 1.6rem;
  border-radius: var(--r-m);
  background: var(--info-soft);
  color: var(--ink);
}

.rd .notice .icon {
  color: var(--info);
  margin-top: .2rem;
}

.rd .notice-warn {
  background: var(--warn-soft);
}

.rd .notice-warn .icon {
  color: var(--warn);
}

.rd .notice-bad {
  background: var(--danger-soft);
}

.rd .notice-bad .icon {
  color: var(--danger);
}

.rd .notice-ok {
  background: var(--brand-soft);
}

.rd .notice-ok .icon {
  color: var(--action);
}

.rd .notice-body {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

.rd .notice-body strong {
  display: block;
  font-weight: 500;
}

.rd .notice-actions {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ——— Меню (компанії, профіль) ——— */
.rd .menu {
  position: absolute;
  top: calc(100% + .6rem);
  left: 0;
  min-width: min(30rem, calc(100vw - 2.4rem));
  max-width: min(36rem, calc(100vw - 2.4rem));
  max-height: min(42rem, 70vh);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-2);
  padding: .6rem;
  z-index: 50;
}

.rd .menu[hidden] {
  display: none;
}

.rd .menu-search {
  padding: .6rem;
}

.rd .menu-search input {
  min-height: 3.8rem;
}

.rd .menu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.2rem;
  border: 0;
  border-radius: var(--r-s);
  background: none;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.rd .menu-item:hover {
  background: var(--canvas);
  box-shadow: none;
  color: var(--ink);
}

.rd .menu-item:focus-visible {
  background: var(--canvas);
  box-shadow: inset 0 0 0 2px var(--focus-ring);
}

.rd .menu-item[aria-checked="true"] {
  font-weight: 500;
}

.rd .menu-item[aria-checked="true"]::after {
  content: "";
  margin-left: auto;
  width: 1.6rem;
  height: 1.6rem;
  flex: none;
  background: var(--action);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17 19 7'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17 19 7'/%3E%3C/svg%3E") center/contain no-repeat;
}

.rd .menu-item[aria-disabled="true"] {
  cursor: not-allowed;
  color: var(--ink-3);
}

.rd .menu-item[aria-disabled="true"]:hover {
  background: none;
}

.rd .menu-item .cell-sub {
  font-weight: 400;
}

.rd .menu-item>span {
  overflow-wrap: break-word;
  min-width: 0;
}

.rd .menu-group {
  font-size: var(--t-xs);
  color: var(--ink-3);
  padding: 1rem 1.2rem .4rem;
}

.rd .menu-sep {
  height: 1px;
  margin: .6rem .8rem;
  background: var(--line);
}

.rd .menu-action .cell-sub {
  display: block;
}

.rd .menu-note {
  padding: .8rem 1.2rem;
  font-size: var(--t-s);
  color: var(--ink-3);
}

/* ——— SelectMenu: тригер як поле, список — .menu ——— */
.rd .sel { position: relative; display: inline-block; min-width: 0; max-width: 100%; vertical-align: top; }
.rd .sel-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: .8rem; width: 100%; min-height: 4.4rem; padding: 1rem 1.2rem; font: 400 var(--t-m)/1.3 var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--field-border); border-radius: var(--r-m); cursor: pointer; text-align: left; }
.rd .sel-btn:hover { border-color: var(--ink-3); }
.rd .sel-btn:focus-visible { outline: none; border-color: var(--action); box-shadow: 0 0 0 3px rgba(47, 122, 22, .2); }
.rd .sel-btn .icon { color: var(--ink-3); flex: none; }
.rd .sel-v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd .sel-menu { min-width: 100%; max-width: min(40rem, calc(100vw - 2.4rem)); }
.rd .sel.w-auto { width: auto; }
.rd .sel.w-auto .sel-btn { width: auto; min-width: 14rem; }
@media (max-width: 640px) {
  .rd .sel, .rd .sel-btn { width: 100%; }
  .rd .sel.w-auto .sel-btn { width: 100%; min-width: 0; }
}

/* ——— Аватар і логотип компанії ——— */
/* Аватар — не сигнал: за замовчуванням нейтральний (D-10, Non-Signal Avatar) */
.rd .avatar {
  display: inline-grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font: 700 1.2rem/1 var(--font);
  letter-spacing: .02em;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.rd .avatar-s {
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.1rem;
}

.rd .avatar-l {
  width: 4.4rem;
  height: 4.4rem;
  font-size: 1.5rem;
}

.rd .co-logo {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: var(--r-s);
  object-fit: cover;
  flex: none;
}

.rd .co-logo-empty {
  display: inline-grid;
  place-items: center;
  background: var(--brand-deep);
  color: #fff;
  font: 700 1.2rem/1 var(--font);
}

.rd .co-logo-s {
  width: 2.6rem;
  height: 2.6rem;
}

.rd .co-logo-l {
  width: 4.8rem;
  height: 4.8rem;
  border-radius: var(--r-m);
  font-size: 1.8rem;
}

/* ——— Бічна панель (drawer) ——— */
.rd .drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 35, 38, .32);
  z-index: 60;
  opacity: 0;
  transition: opacity .2s;
}

.rd .drawer-backdrop.show {
  opacity: 1;
}

.rd .drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(48rem, 92vw);
  background: var(--surface);
  color: var(--ink);
  z-index: 61;
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s var(--ease);
}

.rd .drawer.show {
  transform: none;
}

.rd .drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.8rem 2.4rem;
  border-bottom: 1px solid var(--line);
}

.rd .drawer-body {
  padding: 2.4rem;
  overflow: auto;
  flex: 1;
  overflow-wrap: break-word;
}

.rd .drawer-foot {
  padding: 1.6rem 2.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
}

/* ——— Діалог на нативному <dialog> ——— */
.rd dialog {
  border: 0;
  padding: 0;
  border-radius: var(--r-l);
  box-shadow: var(--shadow-2);
  width: min(52rem, calc(100vw - 3.2rem));
  color: var(--ink);
  background: var(--surface);
}

.rd dialog::backdrop {
  background: rgba(31, 35, 38, .4);
}

.rd dialog[open] {
  animation: rd-dlg .22s var(--ease);
}

@keyframes rd-dlg {
  from {
    opacity: 0;
    transform: translateY(.8rem) scale(.98);
  }
}

.rd .dlg-body {
  padding: 2.4rem 2.4rem .8rem;
  overflow-wrap: break-word;
}

.rd .dlg-body h2 {
  margin-bottom: 1rem;
}

.rd .dlg-body p+p {
  margin-top: 1rem;
}

.rd .dlg-foot {
  display: flex;
  justify-content: flex-end;
  gap: .8rem;
  padding: 1.6rem 2.4rem 2.4rem;
  flex-wrap: wrap;
}

/* ——— Тости ——— */
.rd.toasts,
.rd .toasts {
  position: fixed;
  right: 2.4rem;
  bottom: 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 80;
  max-width: min(42rem, calc(100vw - 3.2rem));
}

/* Bootstrap: .toast:not(.show) { display: none } і власні ширина, фон, рамка — тут усе своє */
.rd .toast {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  width: auto;
  max-width: none;
  padding: 1.4rem 1.6rem;
  border: 0;
  border-radius: var(--r-m);
  background: var(--tip-bg);
  color: var(--tip-fg);
  box-shadow: var(--shadow-2);
  font-size: var(--t-m);
  animation: rd-toast .3s var(--ease);
  overflow-wrap: break-word;
  opacity: 1;
}

.rd .toast .icon {
  margin-top: .2rem;
}

.rd .toast-ok .icon {
  color: #9BD27A;
}

.rd .toast-bad {
  background: #5A1216;
}

.rd .toast-bad .icon {
  color: #FFB4B8;
}

.rd .toast strong {
  display: block;
  font-weight: 500;
}

.rd .toast p {
  color: #D6DADD;
  font-size: var(--t-s);
  margin-top: .2rem;
}

.rd .toast .link-btn {
  color: #CFE8BE;
  margin-top: .6rem;
}

.rd .toast-close {
  background: none;
  border: 0;
  color: #D6DADD;
  padding: .6rem;
  margin: -.4rem -.6rem -.4rem auto;
  cursor: pointer;
  border-radius: 4px;
}

/* ціль 28×28 */
@keyframes rd-toast {
  from {
    opacity: 0;
    transform: translateY(1.2rem);
  }
}

@media (max-width: 640px) {

  .rd.toasts,
  .rd .toasts {
    right: 1.6rem;
    left: 1.6rem;
    bottom: 7.2rem;
  }

  .rd dialog .dlg-body,
  .rd .toast,
  .rd .drawer-body,
  .rd .notice-body {
    overflow-wrap: anywhere;
  }

  .rd .dlg-foot {
    flex-direction: column-reverse;
  }

  .rd .dlg-foot .btn {
    flex: 1 1 100%;
    white-space: normal;
  }
}

/* ——— Панель «Вигляд» (тема і «Великий текст і контраст») ——— */
.rd .view-menu {
  position: relative;
}

.rd .view-panel {
  position: absolute;
  right: 0;
  top: calc(100% + .6rem);
  width: 30rem;
  max-width: calc(100vw - 2.4rem);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-2);
  padding: 1.6rem;
  z-index: 55;
}

.rd .view-panel[hidden] {
  display: none;
}

.rd .view-panel h2 {
  font-size: var(--t-m);
  margin-bottom: 1rem;
}

.rd .view-panel fieldset {
  border: 0;
  margin: 0 0 1.4rem;
  padding: 0;
  min-width: 0;
}

.rd .view-panel legend {
  float: none;
  width: auto;
  font-size: var(--t-xs);
  font-weight: 400;
  color: var(--ink-3);
  margin-bottom: .6rem;
  padding: 0;
  line-height: 1.5;
}

.rd .theme-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
}

.rd .theme-opt {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .8rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-m);
  background: var(--surface);
  color: var(--ink);
  font: 500 var(--t-s)/1.2 var(--font);
  cursor: pointer;
  text-align: left;
}

.rd .theme-opt[aria-checked="true"] {
  border-color: var(--action);
  box-shadow: inset 0 0 0 1px var(--action);
}

.rd .theme-dot {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  flex: none;
  border: 1px solid rgba(0, 0, 0, .2);
}

.rd .a11y-row {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
}

.rd .a11y-row p {
  font-size: var(--t-s);
  color: var(--ink-3);
  margin-top: .2rem;
}

/* Увімкнений режим видно на самій кнопці: заливка й контур */
.rd #a11y-btn[aria-pressed="true"] {
  --bg: var(--ink);
  --fg: var(--surface);
  color: var(--surface);
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #FFD400;
}

/* ——— «Великий текст і контраст» для компонентів ——— */
html[data-a11y="lowvision"] .rd .btn-danger {
  --bg: var(--danger-bg);
  --bd: var(--danger-bg);
  --fg: #FFFFFF;
}

html[data-a11y="lowvision"] .rd .btn-danger:hover {
  --bg: var(--danger-bg-hover);
  --bd: var(--danger-bg-hover);
}

html[data-a11y="lowvision"] .rd main a:not(.btn),
html[data-a11y="lowvision"] .rd .link-btn {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
}

html[data-a11y="lowvision"] .rd :focus-visible {
  outline: 3px solid #FFD400 !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--ink) !important;
}

html[data-a11y="lowvision"] .rd .panel,
html[data-a11y="lowvision"] .rd input,
html[data-a11y="lowvision"] .rd .btn,
html[data-a11y="lowvision"] .rd .chip {
  border-width: 2px !important;
}

html[data-a11y="lowvision"] .rd .btn {
  min-height: 4.8rem;
}

html[data-a11y="lowvision"] .rd .btn-icon {
  width: 4.8rem;
}

html[data-a11y="lowvision"] .rd .muted,
html[data-a11y="lowvision"] .rd .small,
html[data-a11y="lowvision"] .rd .cell-sub {
  color: var(--ink-2) !important;
}

html[data-a11y="lowvision"] .rd .badge,
html[data-a11y="lowvision"] .rd .notice {
  border: 2px solid var(--line-strong);
}

html[data-a11y="lowvision"] .rd *,
html[data-a11y="lowvision"] .rd *::before,
html[data-a11y="lowvision"] .rd *::after {
  animation: none !important;
  transition: none !important;
}

html[data-theme="dark"] .rd .btn-danger,
html[data-theme="night"] .rd .btn-danger {
  --bg: var(--danger-bg);
  --bd: var(--danger-bg);
  --fg: #FFFFFF;
}

html[data-theme="dark"] .rd .btn-danger:hover,
html[data-theme="night"] .rd .btn-danger:hover {
  --bg: var(--danger-bg-hover);
  --bd: var(--danger-bg-hover);
}

@media (max-width: 640px) {
  html[data-a11y="lowvision"] .rd .badge {
    white-space: normal;
  }

  /* A-14: великий текст на телефоні — довгі підписи кнопок переносяться, а не виходять за екран */
  html[data-a11y="lowvision"] .rd .btn {
    white-space: normal;
    max-width: 100%;
    line-height: 1.2;
    padding-top: .6rem;
    padding-bottom: .6rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  .rd *,
  .rd *::before,
  .rd *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}