/* Валютный конвертер — по мотивам конвертера XE: светло-серый фон, панели
   с белыми строками, ярко-синий акцент, «пилюли».
   Светлая и тёмная темы: по системе, либо выбранная кнопкой в шапке. */

/* Безопасные зоны iPhone: вырез и Dynamic Island сверху (в горизонтальной
   ориентации — сбоку), полоска «домой» снизу. Страница с viewport-fit=cover
   заходит под них, поэтому шапка и поля отступают на эти величины. */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

:root {
  --bg:          #eceef2;
  --panel:       #dfe3ea;
  --row:         #ffffff;
  --row-hover:   #f3f5f8;
  --ink:         #16181d;
  --ink-2:       #575c66;
  --line:        #e4e7ed;
  --border:      #8c919c;       /* граница полей и переключателей, ≥3:1 к белому */
  --blue:        #1240ff;       /* заливка с белым текстом и синий текст */
  --blue-ink:    #1240ff;
  --blue-soft:   rgba(18, 64, 255, .1);
  --on-blue:     #ffffff;
  --chip-on-bg:  var(--ink);    /* выбранная частая валюта */
  --chip-on-ink: #ffffff;
  --up:          #0f7b3f;
  --down:        #c42b3a;
  --warn:        #8a5a00;
  --warn-bg:     #fff3d6;
  --danger-bg:   #fde8ea;
  --hatch:       rgba(22, 24, 29, .06);
  --shadow:      0 1px 2px rgba(22, 24, 29, .06), 0 8px 24px rgba(22, 24, 29, .06);
  --pop-shadow:  0 12px 40px rgba(22, 24, 29, .18), 0 2px 6px rgba(22, 24, 29, .08);
  --bar:         rgba(236, 238, 242, .82);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0d0f14;
    --panel:       #171a22;
    --row:         #222631;
    --row-hover:   #2a2f3c;
    --ink:         #f3f4f6;
    --ink-2:       #a2a8b4;
    --line:        #2e3340;
    --border:      #6b7180;
    --blue:        #3b64ff;
    --blue-ink:    #8aa2ff;
    --blue-soft:   rgba(59, 100, 255, .2);
    --chip-on-bg:  #ffffff;   /* кнопка остаётся белой, код валюты — синий */
    --chip-on-ink: #3b64ff;
    --up:          #3dd68c;
    --down:        #ff6b78;
    --warn:        #ffc94d;
    --warn-bg:     rgba(255, 201, 77, .1);
    --danger-bg:   rgba(255, 107, 120, .1);
    --hatch:       rgba(255, 255, 255, .05);
    --shadow:      none;
    --pop-shadow:  0 12px 40px rgba(0, 0, 0, .55);
    --bar:         rgba(13, 15, 20, .82);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:          #0d0f14;
  --panel:       #171a22;
  --row:         #222631;
  --row-hover:   #2a2f3c;
  --ink:         #f3f4f6;
  --ink-2:       #a2a8b4;
  --line:        #2e3340;
  --border:      #6b7180;
  --blue:        #3b64ff;
  --blue-ink:    #8aa2ff;
  --blue-soft:   rgba(59, 100, 255, .2);
  --chip-on-bg:  #ffffff;
  --chip-on-ink: #3b64ff;
  --up:          #3dd68c;
  --down:        #ff6b78;
  --warn:        #ffc94d;
  --warn-bg:     rgba(255, 201, 77, .1);
  --danger-bg:   rgba(255, 107, 120, .1);
  --hatch:       rgba(255, 255, 255, .05);
  --shadow:      none;
  --pop-shadow:  0 12px 40px rgba(0, 0, 0, .55);
  --bar:         rgba(13, 15, 20, .82);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.45 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
/* без серой вспышки при касании и без задержки двойного тапа */
a, button, label, input, .opt { -webkit-tap-highlight-color: transparent; }
a, button, label, .opt { touch-action: manipulation; }
a { color: var(--blue-ink); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(16px, var(--sal));
  padding-right: max(16px, var(--sar));
}

/* --- шапка ---------------------------------------------------------------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  /* фон шапки уходит под Dynamic Island, кнопки остаются ниже него */
  padding-top: var(--sat);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
}
.bar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 6px; font-size: 19px; font-weight: 600; }
.bar-actions { display: flex; gap: 8px; }

/* «конвертер» — чип, открывает выбор раздела: конвертер или монитор */
.switch { position: relative; display: inline-flex; }
.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-ink);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.brand-chip .chevron { color: currentColor; transition: transform .15s; }
.brand-chip[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  display: grid;
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--row);
  box-shadow: var(--pop-shadow);
}
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}
.menu-item:focus-visible { background: var(--row-hover); outline: none; }
.menu-item.is-current { color: var(--blue-ink); }
.menu-item svg { width: 16px; height: 16px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--row);
  color: var(--ink);
  cursor: pointer;
  transition: background .15s;
}
.icon-btn:disabled { cursor: default; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.busy svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* в светлой теме кнопка предлагает луну, в тёмной — солнце */
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

.chevron { width: 12px; height: 8px; flex: none; color: var(--ink-2); transition: transform .15s; }

/* наведение — только там, где есть мышь: на iPhone подсветка «залипает» после касания */
@media (hover: hover) {
  .brand-chip:hover { background: color-mix(in srgb, var(--blue) 18%, transparent); }
  .menu-item:hover { background: var(--row-hover); }
  .icon-btn:hover { background: var(--row-hover); }
  .cur-btn:hover { background: var(--row-hover); }
  .chip:hover span { border-color: var(--border); }
  .seg label:hover span { background: var(--row-hover); }
  .opt:hover { background: var(--row-hover); }
}

/* --- под шапкой: пояснение и время курса ------------------------------------ */
.hero { padding: 8px 0 20px; text-align: center; }
.hero-sub { font-size: 16px; color: var(--ink-2); }
.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--row);
  font-size: 14px;
  font-weight: 500;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex: none; }
.dot.ok   { background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 25%, transparent); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 25%, transparent); }
.dot.bad  { background: var(--down); box-shadow: 0 0 0 3px color-mix(in srgb, var(--down) 25%, transparent); }

/* --- панели и строки ------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 28px;
  background: var(--panel);
  min-width: 0;
}
.panel-title {
  padding: 10px 14px 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}
.row {
  padding: 18px 20px;
  border-radius: 20px;
  background: var(--row);
  box-shadow: var(--shadow);
  min-width: 0;
}
.row-label { display: block; margin-bottom: 10px; font-size: 15px; font-weight: 600; }
.row-label .opt { margin-left: 6px; font-size: 14px; font-weight: 400; color: var(--ink-2); }
.row-hint { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.error { margin-top: 8px; font-size: 14px; color: var(--down); }

/* --- валюта и сумма: рядом, но отдельно ------------------------------------- */
.cur-amount { display: flex; align-items: flex-end; gap: 12px; }
.picker { position: relative; flex: none; }
.amount { flex: 1; min-width: 0; }

.cur-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 16px 0 18px;
  border: 0;
  border-radius: 16px;
  background: var(--bg);
  cursor: pointer;
  transition: background .15s;
}
.cur-btn[aria-expanded="true"] { background: var(--blue-soft); }
.cur-btn[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.cur-code { font-size: 20px; font-weight: 600; letter-spacing: .01em; }

/* поле суммы: синяя рамка — сразу видно, куда вводить */
.amount-field {
  display: flex;
  align-items: center;
  height: 56px;
  border: 2px solid var(--blue);
  border-radius: 16px;
  background: var(--row);
  transition: box-shadow .15s, border-color .15s;
}
.amount-field:focus-within { box-shadow: 0 0 0 4px var(--blue-soft); }
.amount-field.invalid { border-color: var(--down); }
.amount-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 16px;
  border: 0;
  background: none;
  outline: none;
  text-align: right;
  font-size: 28px;
  font-weight: 500;
}
.amount-input::placeholder { color: var(--border); }

/* выбор валюты: небольшое окно рядом с кнопкой — поиск сверху, список со
   всегда видимой полосой прокрутки */
.pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: 320px;
  max-width: calc(100vw - 32px - var(--sal) - var(--sar));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--row);
  box-shadow: var(--pop-shadow);
}
.pop-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--row);
}
.pop-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.pop-search svg { width: 18px; height: 18px; flex: none; color: var(--ink-2); }
.pop-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  outline: none;
  font-size: 16px;
}
.pop-search input::placeholder { color: var(--ink-2); }
.pop-list {
  position: relative;
  max-height: 264px;
  margin-top: 8px;
  padding-right: 4px;
  overflow-y: scroll;
  overscroll-behavior: contain;
}
.pop-list::-webkit-scrollbar { width: 10px; }
.pop-list::-webkit-scrollbar-track { background: var(--bg); border-radius: 10px; }
.pop-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 2px solid var(--bg); }
@supports not selector(::-webkit-scrollbar) {
  .pop-list { scrollbar-width: thin; scrollbar-color: var(--border) var(--bg); }
}
.opt {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
  padding: 11px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.opt b { flex: none; width: 40px; font-weight: 600; }
.opt span { min-width: 0; color: var(--ink-2); font-size: 14px; }
.opt.active { background: var(--row-hover); }
.opt[aria-selected="true"] b,
.opt[aria-selected="true"] span { color: var(--blue-ink); }
.pop-empty { padding: 14px 10px; font-size: 14px; color: var(--ink-2); }

.chips {
  display: flex;
  gap: 8px;
  margin: 16px -20px 0;
  padding: 2px 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip { position: relative; flex: none; }
.chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--row);
  font-size: 15px;
  font-weight: 500;
  transition: background .15s, border-color .15s, color .15s;
}
.chip input:checked + span { background: var(--chip-on-bg); border-color: var(--chip-on-bg); color: var(--chip-on-ink); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* --- переключатели с явными границами ------------------------------------------ */
.seg {
  display: grid;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg label { position: relative; }
.seg label + label { border-left: 1px solid var(--border); }
.seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 0 8px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.seg input:checked + span,
.seg label:hover input:checked + span { background: var(--blue); color: var(--on-blue); }
.seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: -4px; box-shadow: inset 0 0 0 4px var(--row); }
/* курс на завтра ещё не объявлен — вариант заштрихован и не выбирается */
.seg input:disabled { cursor: not-allowed; }
.seg input:disabled + span,
.seg label:hover input:disabled + span {
  color: var(--ink-2);
  background: repeating-linear-gradient(135deg, var(--hatch) 0 6px, transparent 6px 12px);
}

.usd-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.usd-num { font-size: 26px; font-weight: 500; white-space: nowrap; }
.usd-num .unit { margin-left: 6px; font-size: 15px; color: var(--ink-2); }
.usd-src { font-size: 14px; color: var(--ink-2); text-align: right; }
.usd-manual { margin-top: 14px; }

/* --- поля ------------------------------------------------------------------- */
.field {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--row);
  transition: border-color .15s, box-shadow .15s;
}
.field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.field.invalid { border-color: var(--down); }
.field input {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 0 0 16px;
  border: 0;
  background: none;
  outline: none;
  font-size: 20px;
  font-weight: 500;
}
.field input::placeholder { color: var(--border); }
.field .suffix { flex: none; padding: 0 16px 0 8px; font-size: 15px; color: var(--ink-2); }
.fee-line { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.fee-line .field { flex: 0 1 200px; }
.fee-hint { font-size: 14px; color: var(--ink-2); white-space: nowrap; }

/* --- итог --------------------------------------------------------------------- */
/* плашка и строка суммы — кнопки: по нажатию копируются курс и расчёт */
.copy {
  width: 100%;
  margin: 0;
  border: 0;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
}
.copy:active { opacity: .85; }
.copy .line-label { display: block; }
.line-sub.copied { color: var(--up); font-weight: 500; }
@media (hover: hover) {
  .banner.copy:hover { background: color-mix(in srgb, var(--blue) 88%, #000); }
  .line.copy:hover { background: var(--row-hover); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.banner {
  display: block;
  padding: 18px 22px 20px;
  border-radius: 20px;
  background: var(--blue);
  color: var(--on-blue);
  text-align: center;
  container-type: inline-size;
}
.banner-title, .banner-rate, .banner-sub { display: block; }
.banner-title { font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, .88); }
/* кегль подстраивается под ширину плашки: «1 VND = 0,0031145 ₽» тоже в строку */
.banner-rate {
  margin-top: 6px;
  font-size: 34px;
  font-size: min(36px, calc(100cqi / 10.5));
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.banner-sub { margin-top: 6px; font-size: 14px; color: rgba(255, 255, 255, .85); }

/* строка «подпись в две строки слева — крупное значение справа»: значение по
   центру этих двух строк и высотой с них; на узком экране кегль значения
   уменьшается так, чтобы оно помещалось целиком (--w — ширина числа в em,
   её считает скрипт) */
.line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  container-type: inline-size;
}
.line-text { flex: 1 1 auto; min-width: 0; }
.line-label { font-size: 16px; font-weight: 600; }
.line-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.line-sub .badge { height: 20px; }
.line-value {
  flex: none;
  font-size: 34px;
  font-size: min(44px, calc((100cqi - 150px) / var(--w, 6)));
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.line-value .unit { margin-left: .15em; font-size: .6em; color: var(--ink-2); }

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #fbe7b5;
  color: #6b4700;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge-xe       { background: var(--blue-soft); color: var(--blue-ink); }
.badge-manual   { background: #e9e0ff; color: #4b2aa8; }
.badge-calc     { background: var(--bg); color: var(--ink); }
.badge-fallback { background: var(--warn-bg); color: var(--warn); }
:root[data-theme="dark"] .badge:not(.badge-xe):not(.badge-calc):not(.badge-fallback) { background: rgba(245, 178, 62, .16); color: #f5c46a; }
:root[data-theme="dark"] .badge-manual { background: rgba(167, 139, 250, .18); color: #c4b1ff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge:not(.badge-xe):not(.badge-calc):not(.badge-fallback) { background: rgba(245, 178, 62, .16); color: #f5c46a; }
  :root:not([data-theme="light"]) .badge-manual { background: rgba(167, 139, 250, .18); color: #c4b1ff; }
}

.fineprint {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 14px 8px;
  font-size: 13px;
  color: var(--ink-2);
}
.fineprint svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }

/* --- предупреждения ------------------------------------------------------------ */
.notices { display: grid; gap: 10px; max-width: 760px; margin: 0 auto 20px; }
.notices:empty { display: none; }
.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--warn-bg);
  font-size: 15px;
}
.notice b { color: var(--warn); }
.notice.is-error { background: var(--danger-bg); }
.notice.is-error b { color: var(--down); }
.notice p { flex: 1; min-width: 220px; }
.notice button {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: var(--on-blue);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

/* --- подвал -------------------------------------------------------------------- */
.foot {
  max-width: 680px;
  margin: 28px auto 0;
  padding-bottom: max(32px, calc(var(--sab) + 16px));
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}
.foot p + p { margin-top: 4px; }

/* --- широкий экран: быстрые валюты переносом -------------------------------------- */
@media (min-width: 901px) {
  .chips { flex-wrap: wrap; margin: 16px 0 0; padding: 0; overflow: visible; }

  /* Половины выровнены и по верху, и по низу. Лишнюю высоту забирают строки
     той половины, что короче: слева — карточки параметров, справа — строки
     «Курсов в расчёте» (их содержимое остаётся по центру). */
  .layout > .panel > .row { flex: 1 1 auto; }
  .col > .panel:last-child { flex: 1 1 auto; }
  .col > .panel:last-child > .row { flex: 1 1 auto; }
}

/* --- планшет и телефон: всё в столбик, ввод до итога ------------------------------ */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .bar-row { min-height: 56px; }
  .brand { font-size: 17px; }
  .brand-chip { height: 36px; padding: 0 10px 0 12px; }
  .hero { padding: 4px 0 16px; }
  .hero-sub { font-size: 15px; }
  .panel { border-radius: 24px; padding: 6px; gap: 6px; }
  .row { padding: 16px; border-radius: 18px; }
  .chips { margin: 14px -16px 0; padding: 2px 16px; }
  .cur-btn { padding: 0 12px 0 14px; }
  .amount-input { font-size: 24px; }
  .fee-line { flex-wrap: wrap; gap: 8px 16px; }
  .line { gap: 12px; }
  .line-label { font-size: 15px; }
  .line-value { font-size: min(36px, calc((100cqi - 136px) / var(--w, 6))); }
}

@media (max-height: 500px) and (orientation: landscape) {
  .bar { position: static; }
  .bar-row { min-height: 52px; }
  .hero { padding: 4px 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .icon-btn.busy svg { animation: none; opacity: .4; }
  * { transition-duration: 0ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .bar { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
