/* Новый вид сайта (стиль iOS). Работает только когда у <body> есть класс newui; без него файл ничего не меняет.
   Просто = светлая тема, Профи (.nu-dark) = тёмная. Новые классы — с префиксом nu-. */

/* ---------- токены: старые страницы тоже перекрашиваются, потому что берут цвета отсюда ---------- */
body.newui {
  --nu-top: 56px;
  --bg: #F2F2F7; --card: #FFFFFF; --soft: #F2F2F7; --soft-2: #E5E5EA; --text: #000000; --muted: #8E8E93; --faint: #AEAEB2;
  --border: #D1D1D6; --accent: #007AFF; --accent-hover: #0A6FE0; --accent-soft: #E5F1FF; --accent-text: #007AFF; --on-accent: #fff;
  --good: #248A3D; --good-fill: #34C759; --good-soft: #E3F7E8;
  --warn: #C93400; --warn-fill: #FF9500; --warn-soft: #FFF1DC;
  --bad: #D70015; --bad-fill: #FF3B30; --bad-soft: #FFE5E3;
  --shadow: none; --shadow-hover: 0 4px 16px rgba(0,0,0,.08);
  --radius: 14px; --radius-sm: 10px; --sidebar: 236px;
  --nu-sep: rgba(60,60,67,.18); --nu-blur: rgba(249,249,249,.82);
  font-family: -apple-system, "SF Pro Text", "SF Pro Display", system-ui, "Helvetica Neue", Arial, sans-serif;
}
body.newui.nu-dark {
  --bg: #000000; --card: #1C1C1E; --soft: #2C2C2E; --soft-2: #3A3A3C; --text: #FFFFFF; --muted: #8E8E93; --faint: #636366;
  --border: #38383A; --accent: #0A84FF; --accent-hover: #409CFF; --accent-soft: #0A2A4D; --accent-text: #0A84FF; --on-accent: #fff;
  --good: #30D158; --good-fill: #30D158; --good-soft: #0F2E19;
  --warn: #FF9F0A; --warn-fill: #FF9F0A; --warn-soft: #33230A;
  --bad: #FF453A; --bad-fill: #FF453A; --bad-soft: #3A1512;
  --nu-sep: rgba(84,84,88,.6); --nu-blur: rgba(28,28,30,.82);
  color-scheme: dark;
}
body.newui h1, body.newui h2, body.newui h3, body.newui button, body.newui input, body.newui select { font-family: inherit; }
body.newui .mobile-bar { display: none !important; }
body.newui .sticky-bar { top: var(--nu-top); }
body.newui .card { box-shadow: none; }

/* ---------- шапка ---------- */
.nu-top { display: none; }
body.newui .nu-top { display: block; position: sticky; top: 0; z-index: 35; background: var(--nu-blur);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--nu-sep); }
.nu-bar { display: flex; align-items: center; gap: 12px; min-height: var(--nu-top); padding: 8px 20px; flex-wrap: wrap; }
.nu-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; white-space: nowrap; }
.nu-logo:hover { color: var(--text); }
.nu-logo span.mk { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.nu-logo svg { width: 18px; height: 18px; }
.nu-grow { flex: 1; min-width: 0; }
.nu-menu-btn { display: none; padding: 6px 8px; background: none !important; color: var(--accent); }
.nu-seg { display: inline-flex; background: var(--soft-2); border-radius: 9px; padding: 2px; gap: 2px; flex: none; }
.nu-seg button { background: none; border: 0; border-radius: 7px; padding: 6px 14px; font-size: 14px; font-weight: 500; color: var(--text);
  min-height: 30px; justify-content: center; white-space: nowrap; }
.nu-seg button:hover { background: none; color: var(--text); }
.nu-seg button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.14); font-weight: 600; }
body.nu-dark .nu-seg button.on { background: #636366; }
.nu-pick, .nu-search input { background: var(--soft-2); border: 0; border-radius: 10px; min-height: 36px; padding: 6px 12px; font-size: 15px; color: var(--text); }
.nu-pick { max-width: 220px; cursor: pointer; }
.nu-bar .csel { width: auto; flex: 0 1 220px; min-width: 150px; }
.nu-bar .csel-btn { min-height: 36px; }
.nu-search { position: relative; }
.nu-search input { width: 200px; padding-left: 12px; }
.nu-search input:focus { background: var(--card); border: 0; box-shadow: 0 0 0 2px var(--accent); }
.nu-found { position: absolute; top: 42px; left: 0; width: 280px; max-width: 86vw; background: var(--card); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25); padding: 4px; z-index: 60; max-height: 320px; overflow-y: auto; }
.nu-found a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); font-size: 15px; }
.nu-found a:hover { background: var(--soft); color: var(--text); }
.nu-found .none { padding: 10px 12px; color: var(--muted); font-size: 14px; }
.nu-pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600;
  background: var(--accent); color: #fff; text-decoration: none; white-space: nowrap; min-height: 34px; }
.nu-pill:hover { background: var(--accent-hover); color: #fff; }
.nu-textbtn { background: none !important; border: 0; padding: 6px 8px; font-size: 14px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.nu-textbtn.red { color: var(--bad); }
body.newui .nu-textbtn:hover { opacity: .7; }

.nu-dock { display: none; }

/* строка разделов под шапкой («Просто») */
.nu-tabs { display: none; }
body.nu-simple .nu-tabs { display: flex; gap: 6px; padding: 0 20px 10px; overflow-x: auto; scrollbar-width: none; }
.nu-tabs::-webkit-scrollbar { display: none; }
.nu-tabs a { flex: none; padding: 7px 14px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--text); background: var(--soft-2);
  text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.nu-tabs a:hover { color: var(--text); }
.nu-tabs a.on { background: var(--accent); color: #fff; font-weight: 600; }
.nu-tabs .count { margin-left: 2px; }

/* ---------- раскладка и левое меню («Профи») ---------- */
body.nu-simple .sidebar { display: none; }
body.nu-simple .layout { grid-template-columns: minmax(0, 1fr); }
body.nu-simple .main { max-width: 1200px; margin: 0 auto; width: 100%; }
body.nu-pro .layout { grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - var(--nu-top)); }
body.newui .sidebar { background: var(--bg); border-right: .5px solid var(--nu-sep); top: var(--nu-top); height: calc(100vh - var(--nu-top)); padding: 12px 10px; }
body.newui .sidebar .nav { padding: 9px 12px; border-radius: 10px; font-weight: 500; font-size: 15px; }
body.newui .sidebar .nav:hover { background: var(--soft); }
body.newui .sidebar .nav.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
body.newui .sidebar .nav.on .ico { color: var(--accent); }
body.newui .sidebar .nu-sub { margin: 2px 0 6px 20px; padding-left: 10px; border-left: 1.5px solid var(--nu-sep); display: flex; flex-direction: column; gap: 1px; }
body.newui .sidebar .nu-sub .nav { font-size: 14px; padding: 7px 10px; }
body.newui .sidebar .nu-sub .nav.soon { color: var(--faint); cursor: default; }
body.newui .sidebar .bottom { border-top: .5px solid var(--nu-sep); }
body.newui .main { padding: 20px 24px 64px; }

/* ---------- общие кирпичики ---------- */
.nu-title { font-size: 34px; font-weight: 700; letter-spacing: -.4px; line-height: 1.15; margin: 4px 0 4px; }
.nu-subtitle { font-size: 15px; color: var(--muted); margin-bottom: 20px; }
.nu-h { font-size: 22px; font-weight: 700; letter-spacing: -.2px; margin: 28px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.nu-h a, .nu-h button { font-size: 15px; font-weight: 500; }
.nu-note { font-size: 13px; color: var(--muted); margin-top: 10px; }
.nu-card { background: var(--card); border-radius: 14px; padding: 16px; }
.nu-card.nu-err { color: var(--bad); }
.nu-card.nu-empty { text-align: center; color: var(--muted); padding: 28px 16px; }
.nu-card.nu-empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }

.nu-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.nu-stat { background: var(--card); border-radius: 14px; padding: 16px; min-width: 0; }
.nu-stat .l { font-size: 14px; color: var(--muted); }
.nu-stat .v { font-size: 32px; font-weight: 700; letter-spacing: -.5px; line-height: 1.15; margin: 6px 0 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nu-stat .d { font-size: 14px; font-weight: 600; min-height: 20px; }
.nu-stat .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.nu-up-good, .nu-dn-good { color: var(--good); } .nu-up-bad, .nu-dn-bad { color: var(--bad); } .nu-flat { color: var(--muted); }
.nu-red { color: var(--bad); } .nu-yel { color: var(--warn); } .nu-grn { color: var(--good); }

/* сгруппированный список (inset grouped) */
.nu-group { background: var(--card); border-radius: 14px; overflow: hidden; }
.nu-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; position: relative; min-height: 56px; }
.nu-row + .nu-row::before { content: ""; position: absolute; top: 0; left: 44px; right: 0; border-top: .5px solid var(--nu-sep); }
.nu-lamp { display: inline-block; vertical-align: middle; width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--faint); }
.nu-lamp.red { background: var(--bad-fill); } .nu-lamp.yellow { background: var(--warn-fill); } .nu-lamp.green { background: var(--good-fill); }
.nu-lamp.info { background: var(--accent); }
.nu-row .t { flex: 1; min-width: 0; }
.nu-row .t b { display: block; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.nu-row .t span { display: block; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.nu-go { flex: none; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.nu-go:hover { color: var(--accent); filter: brightness(.95); }
.nu-more { width: 100%; justify-content: center; margin-top: 8px; background: none !important; color: var(--accent); font-weight: 500; }

/* цели месяца */
.nu-goals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.nu-goal { background: var(--card); border-radius: 14px; padding: 16px; min-width: 0; }
.nu-goal .n { font-weight: 600; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }
.nu-goal .n a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nu-goal .big { font-size: 28px; font-weight: 700; letter-spacing: -.4px; margin: 8px 0 8px; font-variant-numeric: tabular-nums; }
.nu-goal .big small { font-size: 15px; color: var(--muted); font-weight: 500; }
.nu-prog { height: 8px; border-radius: 4px; background: var(--soft-2); overflow: hidden; }
.nu-prog i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.nu-prog i.g { background: var(--good-fill); } .nu-prog i.o { background: var(--warn-fill); }
.nu-goal .s { font-size: 13px; color: var(--muted); margin-top: 8px; }
.nu-goal.add { border: 1.5px dashed var(--nu-sep); background: none; display: flex; align-items: center; justify-content: center; min-height: 120px; }
.nu-edit { background: none !important; padding: 2px 6px; color: var(--accent); font-size: 14px; font-weight: 500; }
.nu-heat { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; margin-top: 12px; opacity: .55; }
.nu-heat i { height: 14px; border-radius: 3px; background: var(--soft-2); display: block; }

/* ---------- Клиенты ---------- */
.nu-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.nu-head .nu-subtitle { margin: 0; }
.nu-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.nu-chip { background: var(--card); color: var(--text); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 500; min-height: 34px; }
.nu-chip:hover { background: var(--soft-2); }
.nu-chip.on { background: var(--accent); color: #fff; }
.nu-chip b { font-weight: 700; margin-left: 4px; }
.nu-mass { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.nu-mass b { margin-right: 4px; }
.nu-mass button { background: var(--card); color: var(--accent); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.nu-mass button.soon { color: var(--faint); cursor: default; }
.nu-mass .x { margin-left: auto; background: none; color: var(--muted); }
.nu-tw { background: var(--card); border-radius: 14px; overflow-x: auto; max-width: 100%; }
.nu-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 860px; }
.nu-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 12px 10px; border-bottom: .5px solid var(--nu-sep); white-space: nowrap; cursor: pointer; user-select: none; }
.nu-table th.r, .nu-table td.r { text-align: right; }
.nu-table th.on { color: var(--accent); }
.nu-table td { text-align: left; white-space: normal; padding: 12px 10px; border-bottom: .5px solid var(--nu-sep); vertical-align: middle; font-variant-numeric: tabular-nums; }
.nu-table tr:last-child td { border-bottom: 0; }
.nu-table tbody tr:hover td { background: var(--soft); }
.nu-table td.cl a { color: var(--text); font-weight: 600; display: block; }
.nu-table td.cl small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; max-width: 260px; }
.nu-table .cb { width: 36px; min-width: 0 !important; text-align: center; }
.nu-table th:first-child, .nu-table td:first-child { min-width: 0; }
.nu-table td.r { white-space: nowrap; }
.nu-table .cb input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); cursor: pointer; }
.nu-table .dl { display: block; font-size: 12px; font-weight: 600; }
.nu-legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 12px; }
.nu-legend b { color: var(--text); }
.nu-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.nu-col { background: var(--soft-2); border-radius: 14px; padding: 10px; min-width: 0; }
body.nu-dark .nu-col { background: #111113; }
.nu-col h3 { margin: 4px 6px 10px; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.nu-col h3 span.c { color: var(--muted); font-weight: 500; }
.nu-cards-col { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.nu-cl { display: block; background: var(--card); border-radius: 12px; padding: 12px; color: var(--text); text-decoration: none; }
.nu-cl:hover { color: var(--text); background: var(--soft); }
.nu-cl .n { font-weight: 600; font-size: 15px; margin-bottom: 8px; overflow-wrap: anywhere; }
.nu-cl .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.nu-cl .nums div { font-size: 12px; color: var(--muted); min-width: 0; }
.nu-cl .nums b { display: block; font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.nu-cl .why { font-size: 13px; margin-top: 8px; font-weight: 500; }

/* ---------- ширина: планшет и телефон ---------- */
@media (max-width: 1100px) {
  .nu-search input { width: 150px; }
  .nu-goals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  body.newui .nu-menu-btn { display: inline-flex; }
  body.nu-simple .nu-menu-btn { display: none; }
  body.nu-pro .layout { grid-template-columns: minmax(0, 1fr); }
  body.newui .sidebar { top: 0; height: 100vh; z-index: 45; background: var(--card); }
  body.newui .main { padding: 14px 16px 64px; }
  .nu-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nu-board { grid-template-columns: minmax(0, 1fr); }
  .nu-cards-col { max-height: none; }
  .nu-title { font-size: 30px; }
}
@media (max-width: 700px) {
  /* компактная шапка: логотип и «Просто | Профи» в первой строке, клиент и поиск — под ними */
  .nu-bar { padding: 8px 12px; gap: 8px; min-height: 0; }
  .nu-logo { font-size: 15px; }
  .nu-logo span.mk { width: 26px; height: 26px; border-radius: 7px; }
  .nu-logo svg { width: 16px; height: 16px; }
  .nu-grow, .nu-pill, .nu-stop, #nuOld, body.newui .nu-menu-btn { display: none !important; }
  .nu-seg { margin-left: auto; }
  .nu-seg button { padding: 4px 10px; font-size: 13px; min-height: 26px; }
  .nu-pick, .nu-bar .csel, .nu-search { order: 8; flex: 1 1 40%; min-width: 0; max-width: none; }
  .nu-search input, .nu-pick { width: 100%; min-height: 34px; font-size: 14px; }
  .nu-pick { padding: 4px 8px; text-overflow: ellipsis; }
  .nu-found { width: 100%; }
  /* разделы переехали в нижнюю панель */
  body.nu-simple .nu-tabs { display: none; }
  body.newui .nu-subtabs { display: flex; gap: 4px; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; }
  body.newui .nu-subtabs:empty { display: none; }
  /* «Профи»: боковое меню на телефоне скрыто, разделы — снизу */
  body.nu-pro .sidebar { display: none; }
  body.nu-pro .layout { grid-template-columns: minmax(0, 1fr); }
  /* место под нижнюю панель */
  body.newui .main { padding: 12px 12px calc(76px + env(safe-area-inset-bottom)); min-width: 0; overflow-x: clip; }
  body.newui .toast { bottom: calc(76px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
  /* страницы без горизонтальной прокрутки: широкие таблицы старых страниц прокручиваются внутри себя */
  body.newui .main.nu-legacy table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  body.newui .main.nu-legacy :is(pre, img, canvas, svg) { max-width: 100%; }
  body.newui .main.nu-legacy .card { min-width: 0; }
  .nu-head > div { min-width: 0; max-width: 100%; }
  .nu-head .nu-seg { margin-left: 0; }
  .nu-title { font-size: 28px; }
  /* нижняя панель вкладок */
  body.newui .nu-dock { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--nu-blur);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--nu-sep);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .nu-dock a, .nu-dock button { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0;
    background: none !important; border: 0; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 10.5px; font-weight: 500; min-height: 48px; justify-content: center; }
  .nu-dock a:hover, .nu-dock button:hover { color: var(--muted); }
  .nu-dock .on, .nu-dock a.on:hover, .nu-dock button.on:hover { color: var(--accent); }
  .nu-dock .ico { position: relative; display: grid; place-items: center; width: 26px; height: 26px; }
  .nu-dock .ico svg { width: 24px; height: 24px; }
  .nu-dock .lb { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nu-dock .dot { position: absolute; top: 0; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad-fill); border: 1.5px solid var(--card); }
  .nu-goals { grid-template-columns: minmax(0, 1fr); }
  .nu-stat .v { font-size: 26px; }
  .nu-row { padding: 12px; gap: 10px; flex-wrap: wrap; }
  .nu-row .nu-go { margin-left: 22px; }
  .nu-row + .nu-row::before { left: 12px; }
}

/* =====================================================================================================
   Этап 4: старые страницы в новом виде выглядят как iOS.
   Всё — только под body.newui. Страницы старого сайта получают класс nu-legacy на #main (ставит route() в app.js),
   новые страницы (nu-stats, nu-client, «Сегодня», «Клиенты») этих правил не видят. Окна (.modal) общие.
   ===================================================================================================== */

/* вторая строка «Просто»: инструменты текущего раздела */
.nu-subtabs { display: none; }
body.nu-simple .nu-subtabs { display: flex; gap: 4px; padding: 0 20px 10px; overflow-x: auto; scrollbar-width: none; }
body.nu-simple .nu-subtabs:empty { display: none; }
.nu-subtabs::-webkit-scrollbar { display: none; }
.nu-subtabs a { flex: none; padding: 5px 12px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; }
.nu-subtabs a:hover { color: var(--text); }
.nu-subtabs a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* повторы: «Обзор» и «Деньги» аккаунта теперь живут в «Статистике» */
body.nu-has-client .main.nu-legacy .tabs a[href$="/overview"], body.nu-has-client .main.nu-legacy .tabs a[href$="/spend"] { display: none; }

/* большие заголовки страниц */
body.newui .main.nu-legacy h1, body.newui .main.nu-legacy .page-head h1 { font-size: 34px; font-weight: 700; letter-spacing: -.4px; line-height: 1.15; }
body.newui .main.nu-legacy h2 { font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
body.newui .main.nu-legacy .page-head { margin-bottom: 18px; }
body.newui .main.nu-legacy .page-head .muted { font-size: 15px; }
body.newui .main.nu-legacy .sticky-bar { margin: -6px -24px 14px; padding: 10px 24px; background: var(--nu-blur);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }

/* карточки */
body.newui .main.nu-legacy .card { border-radius: 14px; padding: 18px; box-shadow: none; }
body.newui .main.nu-legacy .advice, body.newui .main.nu-legacy .pin-note, body.newui .main.nu-legacy .todo { border-radius: 12px; }
body.newui .main.nu-legacy .badge { border-radius: 999px; }

/* кнопки-таблетки (обычные кнопки; особые — переключатели, ссылки-кнопки, значки — не трогаем) */
body.newui :is(.main.nu-legacy, .modal) :where(button, .btn):where(:not(.primary, .danger, .toggle, .tab, .seg button, .link-btn, .icon-btn, .csel-btn, .feed-del, .chip, .av, .nav, .pick-list > button)) { border-radius: 999px; font-weight: 600; background: var(--soft-2); }
body.newui :is(.main.nu-legacy, .modal) :where(button, .btn):where(:not(.primary, .danger, .toggle, .tab, .seg button, .link-btn, .icon-btn, .csel-btn, .feed-del, .chip, .av, .nav, .pick-list > button)):hover { background: var(--soft); filter: brightness(.96); }
/* большие кнопки-карточки (заголовок + пояснение внутри) — не «таблетка», а карточка со скруглением */
body.newui :is(.main.nu-legacy, .modal) :where(button, .btn):has(> .small, > .muted, > div, > p, > h3, > h4, > br) { border-radius: 16px; font-weight: 400; text-align: left; }
body.newui :is(.main.nu-legacy, .modal) :where(button.primary, .btn.primary) { border-radius: 999px; background: var(--accent); color: #fff; }
body.newui :is(.main.nu-legacy, .modal) :where(button.primary, .btn.primary):hover { background: var(--accent-hover); color: #fff; }
body.newui :is(.main.nu-legacy, .modal) button.danger { border-radius: 999px; color: var(--bad); background: var(--bad-soft); }
body.newui .main.nu-legacy .toolbar > button:not(.primary):not(.danger), body.newui .main.nu-legacy .toolbar > .btn:not(.primary) { background: var(--card); }
body.newui .pick-list > button { border-radius: 12px; }

/* сегменты и вкладки */
body.newui :is(.main.nu-legacy, .modal) .seg, body.newui .main.nu-legacy .card .seg { background: var(--soft-2); border-radius: 9px; padding: 2px; }
body.newui :is(.main.nu-legacy, .modal) .seg button { border-radius: 7px; padding: 6px 14px; background: none; color: var(--text); font-weight: 500; }
body.newui :is(.main.nu-legacy, .modal) .seg button:hover { background: none; filter: none; }
body.newui :is(.main.nu-legacy, .modal) .seg button.on, body.newui .main.nu-legacy .card .seg button.on, body.newui .modal .seg button.on
  { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.14); font-weight: 600; }
body.nu-dark :is(.main.nu-legacy, .modal) .seg button.on, body.nu-dark .main.nu-legacy .card .seg button.on, body.nu-dark .modal .seg button.on { background: #636366; }
body.newui .main.nu-legacy .tabs { background: var(--soft-2); border-radius: 10px; padding: 2px; gap: 2px; width: fit-content; max-width: 100%; scrollbar-width: none; }
body.newui .main.nu-legacy .tabs::-webkit-scrollbar { display: none; }
body.newui .main.nu-legacy .tab { background: none; border-radius: 8px; padding: 7px 14px; font-size: 14px; font-weight: 500; flex: none; }
body.newui .main.nu-legacy .tab:hover { background: none; }
body.newui .main.nu-legacy .tab.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.14); font-weight: 600; }
body.nu-dark .main.nu-legacy .tab.on { background: #636366; }

/* таблицы: тонкие линии, мелкие серые заголовки */
body.newui .main.nu-legacy :is(th, td) { border-bottom: .5px solid var(--nu-sep); }
body.newui .main.nu-legacy tr:last-child > td { border-bottom: 0; }
body.newui .main.nu-legacy th { font-size: 12px; font-weight: 600; color: var(--muted); }

/* поля */
body.newui :is(.main.nu-legacy, .modal) :is(input, select, textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]) {
  background-color: var(--soft-2); border: 0; border-radius: 10px; min-height: 40px; font-size: 16px; }
body.newui :is(.main.nu-legacy, .modal) :is(input, select, textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):focus {
  background-color: var(--card); box-shadow: 0 0 0 2px var(--accent); }
body.newui .main.nu-legacy .card :is(input, select, textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]) { background-color: var(--soft); }
body.newui .main.nu-legacy .card :is(input, select, textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):focus { background-color: var(--card); }

/* тумблеры как в iOS */
body.newui .toggle { width: 51px; height: 31px; padding: 2px; border-radius: 31px; background: var(--soft-2) !important; }
body.newui .toggle span { width: 27px; height: 27px; }
body.newui .toggle.on { background: var(--good-fill) !important; }
body.newui .toggle.on span { transform: translateX(20px); }

/* окна: на телефоне выезжают снизу как шторка */
body.newui .modal-back { background: rgba(0,0,0,.4); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body.newui .modal { border-radius: 14px; padding: 22px; }
body.newui .modal h2 { font-size: 20px; font-weight: 700; }
body.newui .toast { border-radius: 999px; }

@media (max-width: 900px) {
  body.newui .main.nu-legacy .sticky-bar { margin: -6px -16px 12px; padding: 8px 16px; }
}
@media (max-width: 700px) {
  body.nu-simple .nu-subtabs { padding: 0 12px 10px; }
  body.newui .main.nu-legacy h1, body.newui .main.nu-legacy .page-head h1 { font-size: 30px; }
  body.newui .modal-back { place-items: end center; padding: 0; }
  body.newui .modal { max-width: none; border-radius: 14px 14px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; }
}

/* телефон: в списках дел кнопка уходит под текст, текст не сжимается в столбик */
@media (max-width: 700px) {
  .nu-group .nu-row:has(> .nu-go) { flex-wrap: wrap; }
  .nu-group .nu-row > .t { flex: 1 1 calc(100% - 40px); min-width: 0; }
  .nu-group .nu-row > .nu-go { margin-left: 24px; }
}
