/* Tariscope — єдиний вигляд систем Fregat (гайдбук /Users/Shared/fregat-ui-kit/GUIDE.md; рішення Артьома 18.11.2026:
   «тарископ надо тоже самые стили значки шрифты меню боковое применить»). Взято з css/portal-ui.css Порталу 2.2 й зведено до Tariscope:
   вкладки-повзунок (pt-), шапка розділу (ps-), плитки підсумків (pk-), порожні стани (pe-), вікна (tsm), запит підтвердження (pc-),
   повідомлення (ptoast), спільний вигляд карток, таблиць, кнопок і полів. Розмітку розділів «вдягає» js/ts-ui.js. */

/* ───────────── 0. Основа: кольори сторінки, шрифт, цифри ───────────── */
:root { --ts-bg: #f3f4f6; --ts-surface: #ffffff; --ts-line: rgba(148,163,184,.2); --ts-text: #111827; --ts-text-2: #374151; --ts-muted: #6b7280; }
html.dark { --ts-bg: #111827; --ts-surface: #1f2937; --ts-line: rgba(148,163,184,.12); --ts-text: #f9fafb; --ts-text-2: #e5e7eb; --ts-muted: #9ca3af; }
body { font-family: 'Inter', sans-serif; background-color: var(--ts-bg); color: var(--ts-text); -webkit-font-smoothing: antialiased; }
/* числа в таблицях, плитках і списках (суми, рахунки, телефони, час) — Inter з цифрами однакової ширини, НЕ моноширинний
   (Артьом 19.11; typography/README.md). Моноширинний — лише код (SQL-консоль), журнали й технічні ідентифікатори (логін у профілі). */
.tabular-nums, #main-content td, #main-content .pk-kpi-num, #main-content .ts-tile-count b, .tsm td, .cmdk-main, .cmdk-sub, .bell-time { font-variant-numeric: tabular-nums; }
/* Колір тексту — гайдбук 0.4, розділ 1 (спосіб Б: правила поверх утиліт Tailwind). Статусний текст у світлій темі — лише затемненими відтінками:
   яскраві зелений / жовтий / червоний / синій текстом не проходять контраст 4.5 (рахували Академія й Портал). Знаки, заливки, точки лишаються яскравими. */
html:not(.dark) :is(#main-content, .tsm) :is(.text-green-500, .text-green-600, .text-emerald-500, .text-emerald-600) { color: #1a7d47; }
html:not(.dark) :is(#main-content, .tsm) :is(.text-amber-500, .text-amber-600, .text-yellow-500, .text-yellow-600) { color: #9d5c00; }
html:not(.dark) :is(#main-content, .tsm) :is(.text-red-500, .text-red-600) { color: #b91c1c; }
html:not(.dark) :is(#main-content, .tsm) :is(.text-blue-500, .text-blue-600) { color: #2563a8; }
html:not(.dark) :is(#main-content, .tsm) :is(.text-orange-500, .text-orange-600) { color: #c2410c; }
html:not(.dark) :is(#main-content, .tsm) .text-purple-500 { color: #7c3aed; }
/* приглушений: #9ca3af — лише для темної теми (на білому 2.54); у світлій — #6b7280; у темній #6b7280 (3.4 на картці) → #9ca3af */
html:not(.dark) :is(#main-content, .tsm) :is(.text-gray-400, .text-gray-300) { color: #6b7280; }
html:not(.dark) :is(#main-content, .tsm) :is(.text-gray-400, .text-gray-300)[class*="hover:text-"]:hover { color: #374151; }
html.dark :is(#main-content, .tsm) :is(.dark\:text-gray-500, .dark\:text-gray-600) { color: #9ca3af; }

/* ───────────── 1. Ковзні перемикачі — як в Атласі ─────────────
   Вкладки розділу — лінія 2 px, що їде під активну назву й міняє ширину; сегменти (період, режим, фільтр) — «таблетка».
   transform і width .42s cubic-bezier(.34, 1.32, .5, 1) — покажчик трохи проскакує ціль і повертається. */
.pt-tabs { position: relative; scrollbar-width: none; isolation: isolate; }
.pt-tabs::-webkit-scrollbar { display: none; }
.pt-ind { position: absolute; left: 0; top: 0; z-index: 0; width: 0; height: 0; pointer-events: none; opacity: 0; will-change: transform, width;
  transition: transform .42s cubic-bezier(.34, 1.32, .5, 1), width .42s cubic-bezier(.34, 1.32, .5, 1), height .3s ease, opacity .2s ease; }
.pt-ind.pt-now { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .pt-ind { transition: none !important; } }

/* вкладки розділу: лінія-підкреслення, сіра межа під усім рядом */
.pt-line { display: flex !important; flex-wrap: nowrap !important; gap: 4px !important; overflow-x: auto; overflow-y: hidden; padding: 0 !important; background: transparent !important;
  border: 0 !important; border-bottom: 1px solid rgba(148,163,184,.25) !important; border-radius: 0 !important; box-shadow: none !important; }
html.dark .pt-line { border-bottom-color: rgba(148,163,184,.16) !important; }
.pt-line > :is(button, a) { position: relative; z-index: 1; flex: 0 0 auto; margin: 0 !important; padding: 10px 16px !important; border-color: transparent !important; border-width: 0 !important; border-radius: 0 !important;
  background: transparent !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  font-size: 14px !important; font-weight: 500 !important; line-height: 1.35 !important; white-space: nowrap; color: #6b7280 !important; cursor: pointer; transition: color .25s ease; -webkit-tap-highlight-color: transparent; }
html.dark .pt-line > :is(button, a) { color: #9ca3af !important; }
.pt-line > :is(button, a):hover { color: #374151 !important; }
html.dark .pt-line > :is(button, a):hover { color: #e5e7eb !important; }
.pt-line > .pt-on, .pt-line > .pt-on:hover { color: #7c3aed !important; }
html.dark .pt-line > .pt-on, html.dark .pt-line > .pt-on:hover { color: #c4b5fd !important; }
.pt-line > .pt-ind { border-radius: 2px; background: linear-gradient(90deg, #a78bfa, #7c3aed); box-shadow: 0 0 10px rgba(139, 92, 246, .55); }
.pt-line > :is(button, a) > span:empty { display: none; }

/* сегменти: «таблетка» на фіолетовій доріжці */
.pt-seg { display: inline-flex !important; flex-wrap: wrap; align-items: center; gap: 4px !important; width: auto !important; max-width: 100%; padding: 4px !important; border: 0 !important; border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(139, 92, 246, .10), rgba(99, 102, 241, .07)) !important; box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .2) !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important; overflow: visible !important; vertical-align: top; }
html.dark .pt-seg { background: rgba(15, 12, 35, .65) !important; box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .18) !important; }
.pt-seg > :is(button, a) { position: relative; z-index: 1; flex: 0 0 auto; margin: 0 !important; padding: 6px 14px !important; border: 0 !important; border-radius: 10px !important;
  background: transparent !important; box-shadow: none !important; transform: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  font-size: 13px !important; font-weight: 600 !important; line-height: 1.35 !important; white-space: nowrap; color: #6b7280 !important; cursor: pointer; transition: color .25s ease; -webkit-tap-highlight-color: transparent; }
html.dark .pt-seg > :is(button, a) { color: #9ca3af !important; }
.pt-seg > :is(button, a):hover { color: #374151 !important; }
html.dark .pt-seg > :is(button, a):hover { color: #e5e7eb !important; }
.pt-seg > .pt-on, .pt-seg > .pt-on:hover { color: #6d28d9 !important; }
html.dark .pt-seg > .pt-on, html.dark .pt-seg > .pt-on:hover { color: #f5f3ff !important; }
.pt-seg > .pt-ind { border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(76, 29, 149, .12), 0 4px 14px -4px rgba(124, 58, 237, .35), inset 0 0 0 1px rgba(139, 92, 246, .28); }
html.dark .pt-seg > .pt-ind { background: linear-gradient(135deg, rgba(139, 92, 246, .42), rgba(99, 102, 241, .3)); box-shadow: 0 4px 16px -4px rgba(139, 92, 246, .6), inset 0 0 0 1px rgba(196, 181, 253, .35); }
.pt-seg.pt-solid > .pt-on, .pt-seg.pt-solid > .pt-on:hover, html.dark .pt-seg.pt-solid > .pt-on { color: #fff !important; }
.pt-seg.pt-solid > .pt-ind, html.dark .pt-seg.pt-solid > .pt-ind { background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 4px 14px -4px rgba(124, 58, 237, .7); }
.pt-tabs > :is(button, a):focus-visible { outline: 2px solid #8b5cf6; outline-offset: -2px; }
.pt-pane-in { animation: ptPane .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ptPane { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pt-pane-in { animation: none; } }
@media (max-width: 640px) { .pt-line > :is(button, a) { padding: 10px 12px !important; } .pt-seg > :is(button, a) { padding: 6px 11px !important; } }

/* ───────────── 2. Шапка розділу: значок-плитка 48 px + назва + підзаголовок ───────────── */
#main-content .ps-title { display: flex !important; align-items: center; gap: 14px; margin-top: 0; font-size: 25px !important; line-height: 1.14 !important; font-weight: 800 !important; letter-spacing: -.01em;
  color: #111827 !important; background: none !important; -webkit-text-fill-color: currentColor !important; text-align: left; white-space: normal !important; padding-left: 0 !important; }
html.dark #main-content .ps-title { color: #f9fafb !important; }
.ps-ic { position: relative; width: 48px; height: 48px; border-radius: 15px; display: grid !important; place-items: center; flex-shrink: 0; animation: psIn .5s cubic-bezier(.34, 1.5, .5, 1) both; }
.ps-ic.nav-icon-box[class*="ni-"] { box-shadow: 0 12px 22px -12px var(--ni2), inset 0 1px 0 rgba(255, 255, 255, .34); }
.ps-ic::after { content: ''; position: absolute; right: 8px; bottom: 7px; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 2.5px rgba(74, 222, 128, .32); z-index: 2; }
.ps-ic svg { width: 25px; height: 25px; }
.ps-tx { display: flex; flex-direction: column; min-width: 0; }
.ps-t { min-width: 0; }
.ps-sub { display: block; margin: 4px 0 0 !important; font-size: 13px !important; line-height: 1.3; font-weight: 500 !important; letter-spacing: 0; color: #4b5563 !important; }   /* на тлі сторінки #6b7280 дає 4.39 < 4.5 */
html.dark .ps-sub { color: #9ca3af !important; }
@keyframes psIn { from { opacity: 0; transform: scale(.6) rotate(-10deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ps-ic { animation: none; } }
@media (max-width: 640px) { #main-content .ps-title { font-size: 21px !important; gap: 11px; } .ps-ic { width: 42px; height: 42px; border-radius: 13px; } .ps-ic svg { width: 22px; height: 22px; } .ps-sub { font-size: 12.5px !important; } }
/* заголовки всередині розділу — менші за назву розділу в шапці */
#main-content:has(.ps-title) :is(h2, h3):not(.ps-title):is(.text-2xl, .text-3xl) { font-size: 19px !important; line-height: 1.3 !important; font-weight: 700 !important; }

/* ───────────── 3. Плитки підсумків ───────────── */
.pk-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.pk-kpi { --tint: 139, 92, 246; position: relative; overflow: hidden; display: flex; flex-direction: column; min-width: 0; padding: 14px 16px; border-radius: 16px; text-align: left;
  background: #fff; border: 1px solid rgba(148, 163, 184, .2); box-shadow: 0 10px 24px -14px rgba(15, 23, 42, .3);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, border-color .25s; }
html.dark .pk-kpi { background: #1f2937; border-color: rgba(148, 163, 184, .12); }
.pk-kpi[data-tint="blue"] { --tint: 59, 130, 246; } .pk-kpi[data-tint="sky"] { --tint: 14, 165, 233; } .pk-kpi[data-tint="amber"] { --tint: 245, 158, 11; }
.pk-kpi[data-tint="green"] { --tint: 34, 197, 94; } .pk-kpi[data-tint="red"] { --tint: 239, 68, 68; } .pk-kpi[data-tint="gray"] { --tint: 100, 116, 139; }
.pk-kpi::after { content: ''; position: absolute; inset: auto -30% -70% auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--tint), .16), transparent); pointer-events: none; }
.pk-kpi:hover { transform: translateY(-2px); border-color: rgba(var(--tint), .5); box-shadow: 0 16px 30px -16px rgba(var(--tint), .55); }
.pk-kpi-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pk-kpi-ico { flex-shrink: 0; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; background: rgba(var(--tint), .16); }
.pk-kpi-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; }
html.dark .pk-kpi-label { color: #9ca3af; }
.pk-kpi-num { margin-top: 8px; font-size: 28px; font-weight: 800; line-height: 1.1; color: #111827; }
html.dark .pk-kpi-num { color: #f9fafb; }
.pk-kpi-sub { margin-top: 2px; min-height: 16px; font-size: 12px; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.dark .pk-kpi-sub { color: #9ca3af; }
.pk-kpi-bar { height: 4px; margin-top: 8px; border-radius: 999px; background: rgba(148, 163, 184, .25); overflow: hidden; }
.pk-kpi-bar > i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: linear-gradient(90deg, #8b5cf6, rgb(var(--tint))); transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.pk-kpis.pk-enter .pk-kpi { animation: pkIn .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes pkIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pk-kpis.pk-enter .pk-kpi { animation: none; } .pk-kpi:hover { transform: none; } }
@media (max-width: 640px) { .pk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .pk-kpi { padding: 12px 13px; } .pk-kpi-num { font-size: 24px; } }

/* ───────────── 4. Порожній стан ───────────── */
.pe { max-width: 520px; margin: 18px auto; padding: 20px 26px 24px; text-align: center; border-radius: 22px; background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(250, 245, 255, .9)); border: 1.5px dashed #d8b4fe; }
html.dark .pe { background: linear-gradient(180deg, rgba(31, 41, 55, .7), rgba(46, 16, 101, .25)); border-color: rgba(167, 139, 250, .4); }
.pe-emoji { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.pe-t { margin: 0; font-size: 17px; font-weight: 800; color: #111827; }
html.dark .pe-t { color: #f9fafb; }
.pe-s { margin: 6px auto 0; max-width: 400px; font-size: 13.5px; line-height: 1.45; color: #6b7280; }
html.dark .pe-s { color: #9ca3af; }
.pe.pe-sm { display: flex; align-items: center; gap: 14px; max-width: 460px; padding: 12px 18px; text-align: left; border-radius: 16px; }
.pe.pe-sm .pe-emoji { font-size: 30px; margin: 0; flex-shrink: 0; }
.pe.pe-sm .pe-t { font-size: 14.5px; } .pe.pe-sm .pe-s { margin: 3px 0 0; font-size: 12.5px; }
td > .pe, th > .pe { margin: 14px auto; }

/* ───────────── 5. Картки, таблиці, кнопки, поля в розділах — один вигляд, не чіпаючи розмітки ───────────── */
/* картка: поверхня + межа 1 px + радіус 18 + мʼяка тінь */
#main-content div.bg-white:is(.rounded-xl, .rounded-2xl, .rounded-3xl):is(.shadow, .shadow-sm, .shadow-md, .shadow-lg, .border):not(.pe, .pk-kpi) {
  border-radius: 18px; border: 1px solid rgba(148, 163, 184, .2); box-shadow: 0 10px 28px -18px rgba(15, 23, 42, .35); }
html.dark #main-content div.bg-white:is(.rounded-xl, .rounded-2xl, .rounded-3xl):is(.shadow, .shadow-sm, .shadow-md, .shadow-lg, .border):not(.pe, .pk-kpi) {
  border-color: rgba(148, 163, 184, .12); box-shadow: 0 14px 32px -20px rgba(0, 0, 0, .7); }
/* усередині картки «картки» другого рівня (сірі плашки) — без тіні, радіус 14 */
#main-content .bg-white :is(div.bg-gray-50, div.bg-white):is(.rounded-xl, .rounded-2xl) { border-radius: 14px; box-shadow: none; }
/* таблиці: шапка 11 px великими, рядок на наведенні — фіолетовий відтінок, рівні цифри */
#main-content table > thead > tr > th { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; }
html.dark #main-content table > thead > tr > th { color: #9ca3af; }
#main-content table > tbody > tr { transition: background-color .15s ease; }
#main-content table > tbody > tr:hover { background-color: rgba(139, 92, 246, .055); }
html.dark #main-content table > tbody > tr:hover { background-color: rgba(139, 92, 246, .1); }

/* головна кнопка — завжди фіолетова (рішення Артьома 18.11.2026): сині, індигові, зелені, помаранчеві «головні» стають фіолетовими. Червоні лишаються. */
:is(#main-content, .tsm) :is(button, a):is(.bg-purple-500, .bg-purple-600, .bg-blue-500, .bg-blue-600, .bg-indigo-500, .bg-indigo-600, .bg-green-500, .bg-green-600, .bg-emerald-500, .bg-emerald-600, .bg-orange-500, .bg-amber-500,
    [class*="from-purple-5"], [class*="from-purple-6"], [class*="from-blue-5"], [class*="from-blue-6"], [class*="from-indigo-5"], [class*="from-indigo-6"], [class*="from-emerald-5"], [class*="from-emerald-6"], [class*="from-green-5"], [class*="from-green-6"], [class*="from-orange-5"], [class*="from-amber-5"]):not(.pt-tabs > *, .ts-raw) {
  color: #fff !important; background-color: #7c3aed !important; background-image: linear-gradient(135deg, #8b5cf6, #6d28d9) !important; border-color: transparent !important;
  box-shadow: 0 8px 18px -10px rgba(124, 58, 237, .9); transition: filter .2s ease, transform .15s ease, box-shadow .2s ease; }
:is(#main-content, .tsm) :is(button, a):is(.bg-purple-500, .bg-purple-600, .bg-blue-500, .bg-blue-600, .bg-indigo-500, .bg-indigo-600, .bg-green-500, .bg-green-600, .bg-emerald-500, .bg-emerald-600, .bg-orange-500, .bg-amber-500,
    [class*="from-purple-5"], [class*="from-purple-6"], [class*="from-blue-5"], [class*="from-blue-6"], [class*="from-indigo-5"], [class*="from-indigo-6"], [class*="from-emerald-5"], [class*="from-emerald-6"], [class*="from-green-5"], [class*="from-green-6"], [class*="from-orange-5"], [class*="from-amber-5"]):not(.pt-tabs > *, .ts-raw):hover { filter: brightness(1.08); }
:is(#main-content, .tsm) :is(button, a):is(.bg-purple-600, .bg-blue-600, .bg-indigo-600, .bg-green-600, .bg-emerald-600, [class*="from-"]):not(.pt-tabs > *, .ts-raw):active { transform: scale(.98); }
:is(#main-content, .tsm) button:disabled:is(.bg-purple-600, .bg-blue-600, .bg-green-600, .bg-emerald-600, [class*="from-"]) { filter: grayscale(.4) opacity(.7); box-shadow: none; }
:is(#main-content, .tsm) :is(button, a):is(.bg-purple-600, .bg-blue-600, .bg-indigo-600, .bg-green-600, .bg-emerald-600, .bg-red-600, .bg-red-500, [class*="from-"]):not(.pt-tabs > *, .ts-raw):is(.rounded, .rounded-md, .rounded-lg, .rounded-xl) { border-radius: 12px; }

/* поля: радіус 12, межа, фіолетовий фокус замість синього кільця браузера */
:is(#main-content, .tsm) :is(select, textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"])):not(.ts-raw) {
  border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
:is(#main-content, .tsm) :is(select, textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"])):not(.ts-raw):focus {
  outline: none; border-color: #8b5cf6 !important; box-shadow: 0 0 0 3px rgba(139, 92, 246, .2) !important; --tw-ring-color: transparent; }
:is(#main-content, .tsm) :is(input[type="checkbox"], input[type="radio"]) { accent-color: #7c3aed; }

/* один шрифт: цифри були моноширинним шрифтом — тепер Inter з рівними цифрами. Моноширинний лишається для коду (SQL-консоль, pre / code). */
:is(#main-content, .tsm) .font-mono:not(pre, code, pre *, code *, textarea, [data-code], [data-code] *) { font-family: inherit !important; font-variant-numeric: tabular-nums; letter-spacing: 0; }
/* контурні значки 24×24 у розділах — однієї товщини 2 */
:is(#main-content, .tsm) svg[viewBox="0 0 24 24"][fill="none"]:not(.animate-spin, .animate-spin-slow, .ps-ic *, .nav-icon-box *) :is(path, circle, line, polyline, rect) { stroke-width: 2; }

/* статус — «пігулка» 12 px / 600 */
.status-badge { border-radius: 999px; font-size: 12px; font-weight: 600; padding: 2px 9px; line-height: 1.5; }

/* ───────────── 6. Вікна поверх сторінки (класи ставить js/ts-ui.js) ───────────── */
.tsm { background: rgba(18, 16, 30, .6) !important; -webkit-backdrop-filter: blur(5px) !important; backdrop-filter: blur(5px) !important; animation: tsmIn .16s ease both; }
.tsm > .tsm-p { position: relative; border-radius: 20px !important; border: 1px solid rgba(148, 163, 184, .2) !important; box-shadow: 0 24px 70px -20px rgba(20, 10, 50, .55) !important; animation: tsmPop .22s cubic-bezier(.2, .9, .3, 1.2) both; }
html.dark .tsm > .tsm-p { border-color: rgba(148, 163, 184, .14) !important; }
.tsm .tsm-p h3:first-of-type, .tsm .tsm-p > div:first-child > h3 { font-size: 20px !important; line-height: 1.25 !important; font-weight: 800 !important; letter-spacing: -.01em; }
.tsm .pm-x { position: absolute; top: 14px; right: 14px; z-index: 5; width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border-radius: 50%; border: 0;
  font-size: 22px; line-height: 1; font-weight: 400; color: #6b7280; background: rgba(148, 163, 184, .16); cursor: pointer; transition: background-color .2s, color .2s, transform .2s; }
.tsm .pm-x:hover { background: rgba(139, 92, 246, .16); color: #6d28d9; transform: rotate(90deg); }
html.dark .tsm .pm-x { color: #d1d5db; }
.tsm-p.pm-has-x > :is(h3, div):nth-child(2) { padding-right: 44px; }
/* «Скасувати» — спокійна; червона («видалити») лишається червоною */
.tsm button:is(.cancel-btn, #modal-cancel, [id$="-cancel"]) { background: rgba(148, 163, 184, .18) !important; color: #374151 !important; border: 0 !important; border-radius: 12px !important; font-weight: 600; transition: background-color .2s; }
.tsm button:is(.cancel-btn, #modal-cancel, [id$="-cancel"]):hover { background: rgba(148, 163, 184, .32) !important; }
html.dark .tsm button:is(.cancel-btn, #modal-cancel, [id$="-cancel"]) { color: #e5e7eb !important; }
.tsm :is(button, a):is(.bg-red-600, .bg-red-500) { border-radius: 12px !important; font-weight: 700; }
@keyframes tsmIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes tsmPop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tsm, .tsm > .tsm-p { animation: none; } }
@media (max-width: 640px) { .tsm { padding: 10px !important; } .tsm > .tsm-p { max-height: calc(100dvh - 20px); overflow-y: auto; } }

/* ───────────── 7. Запит «Ви впевнені?» (pConfirm) — замість системного confirm() ───────────── */
.pc-back { position: fixed; inset: 0; z-index: 12000; display: grid; place-items: center; padding: 16px; background: rgba(18, 16, 30, .6); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: pcIn .16s ease both; }
.pc-box { width: min(420px, 100%); padding: 22px 22px 18px; border-radius: 20px; text-align: center; background: #fff; border: 1px solid rgba(148, 163, 184, .2); box-shadow: 0 24px 70px -20px rgba(20, 10, 50, .55); animation: pcPop .22s cubic-bezier(.2, .9, .3, 1.2) both; }
html.dark .pc-box { background: #1f2937; border-color: rgba(148, 163, 184, .14); }
.pc-ico { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.pc-ico.pc-danger { background: linear-gradient(135deg, #fca5a5, #dc2626); }
.pc-text { margin: 0; font-size: 15px; line-height: 1.45; color: #111827; overflow-wrap: anywhere; }
html.dark .pc-text { color: #f9fafb; }
.pc-actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.pc-btn { min-width: 112px; padding: 10px 18px; border-radius: 12px; border: 0; font-size: 14px; font-weight: 700; cursor: pointer; transition: filter .2s, transform .12s, background-color .2s; }
.pc-btn:active { transform: scale(.98); } .pc-btn:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 2px; }
.pc-cancel { color: #374151; background: rgba(148, 163, 184, .2); } .pc-cancel:hover { background: rgba(148, 163, 184, .34); }
html.dark .pc-cancel { color: #e5e7eb; }
.pc-ok { color: #fff; background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 8px 18px -10px rgba(124, 58, 237, .9); }
.pc-red { color: #fff; background: linear-gradient(135deg, #ef4444, #b91c1c); box-shadow: 0 8px 18px -10px rgba(220, 38, 38, .9); }
.pc-ok:hover, .pc-red:hover { filter: brightness(1.08); }
.pc-out { opacity: 0; transition: opacity .16s ease; }
@keyframes pcIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pcPop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pc-back, .pc-box { animation: none; } }

/* ───────────── 8. Повідомлення — картки праворуч унизу ───────────── */
#toast-container { position: fixed; right: 20px; bottom: 20px; z-index: 13000; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.ptoast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; max-width: min(380px, calc(100vw - 32px)); padding: 11px 14px 11px 11px; border-radius: 14px; font-size: 13.5px; line-height: 1.4; color: #111827; background: #fff;
  border: 1px solid rgba(148, 163, 184, .25); box-shadow: 0 18px 44px -18px rgba(20, 10, 50, .5), 0 2px 6px rgba(20, 10, 50, .06); cursor: pointer;
  animation: ptIn .3s cubic-bezier(.2, .8, .2, 1) both; transition: opacity .25s ease, transform .25s ease; }
html.dark .ptoast { color: #f9fafb; background: #1f2937; border-color: rgba(148, 163, 184, .16); }
.ptoast.pt-gone { opacity: 0; transform: translateX(12px); }
.ptoast-ico { flex-shrink: 0; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: #7c3aed; }
.ptoast-success .ptoast-ico { background: #16a34a; } .ptoast-error .ptoast-ico { background: #dc2626; } .ptoast-warning .ptoast-ico { background: #d97706; }
.ptoast-text { min-width: 0; padding-top: 2px; overflow-wrap: anywhere; }
@keyframes ptIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ptoast { animation: none; } }
@media (max-width: 640px) { #toast-container { right: 12px; left: 12px; bottom: 12px; align-items: stretch; } .ptoast { max-width: none; } }

/* ───────────── 9. Сторінка входу — як в Атласі й CRM (fregat-crm, css/app.css «Сторінка входу») ───────────── */
.lg-page { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; overflow: hidden; overflow-y: auto;
  background: linear-gradient(135deg, #131118 0%, #2e1065 50%, #131118 100%); color: #fff; }
.lg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.lg-glow { position: absolute; width: 26rem; height: 26rem; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0; }
.lg-glow-1 { top: -4rem; left: 22%; background: rgba(124, 58, 237, .22); }
.lg-glow-2 { bottom: -4rem; right: 22%; background: rgba(79, 70, 229, .20); }
.lg-container { position: relative; z-index: 10; width: 100%; max-width: 28rem; padding: 0 16px; margin: auto; animation: lgUp .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes lgUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.lg-head { text-align: center; margin-bottom: 22px; }
.lg-badge { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 15px; overflow: hidden; box-shadow: 0 12px 32px -8px rgba(217, 119, 6, .55); }
.lg-badge img { display: block; width: 64px; height: 64px; }
.lg-title-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.lg-title-row h1 { margin: 0; font-size: 30px; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.lg-sub { color: rgba(196, 181, 253, .8); font-size: 13px; margin: 6px 0 0; }
.lg-card { position: relative; overflow: hidden; padding: 32px; border-radius: 16px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 24px 64px rgba(0, 0, 0, .4); }
.lg-owl { position: absolute; right: -14px; bottom: -18px; opacity: .07; pointer-events: none; user-select: none; filter: grayscale(1) brightness(2); }
.lg-owl img { display: block; width: 120px; height: 120px; }
.lg-card-head { position: relative; margin-bottom: 18px; }
.lg-card-head h2 { margin: 0; font-size: 20px; font-weight: 700; color: #fff; }
.lg-card-head p { margin: 2px 0 0; font-size: 12px; color: rgba(255, 255, 255, .55); }
.lg-error { position: relative; padding: 11px 14px; margin-bottom: 14px; font-size: 13px; color: #fca5a5; background: rgba(127, 29, 29, .3); border: 1px solid rgba(185, 28, 28, .5); border-radius: 12px; }
.lg-error[hidden] { display: none; }
.lg-form { position: relative; display: flex; flex-direction: column; gap: 15px; }
.lg-field { display: flex; flex-direction: column; gap: 6px; }
.lg-field label { font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .7); }
.lg-input { box-sizing: border-box; width: 100%; max-width: 100%; padding: 10px 16px; border-radius: 12px; font: inherit; font-size: 15px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); color: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.lg-input::placeholder { color: rgba(255, 255, 255, .3); }
.lg-input:focus { border-color: transparent; box-shadow: inset 0 0 0 2px #a78bfa; }
.lg-input:-webkit-autofill { -webkit-text-fill-color: #fff; -webkit-box-shadow: inset 0 0 0 40px #3b2a63; caret-color: #fff; }
.lg-btn { width: 100%; padding: 13px; margin-top: 4px; border: none; border-radius: 12px; font: inherit; font-size: 15px; font-weight: 600; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 12px 28px -8px rgba(124, 58, 237, .6); transition: transform .15s, filter .15s; }
.lg-btn:hover { transform: scale(1.02); filter: brightness(1.08); }
.lg-btn:active { transform: scale(.98); }
.lg-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.lg-btn:focus-visible, .lg-input:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
.lg-foot { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; padding: 16px; text-align: center; pointer-events: none; }
.lg-foot-1 { font-size: 11px; color: rgba(196, 181, 253, .55); }
.lg-foot-2 { font-size: 10px; color: rgba(255, 255, 255, .3); margin-top: 2px; }
@media (max-height: 640px) { .lg-foot { position: static; } }
@media (prefers-reduced-motion: reduce) { .lg-container { animation: none; } }
html.fx-off .lg-container { animation: none; }

/* Перемикач теми на вході — як у Порталі: угорі праворуч, показує поточну тему (сонце / місяць); плитка 40 × 40, як лупа й дзвіночок */
.lg-theme { position: absolute; top: 16px; right: 16px; z-index: 11; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); color: #c4b5fd; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background .15s, color .15s, transform .15s; }
.lg-theme:hover { background: rgba(255, 255, 255, .14); color: #ddd6fe; }
.lg-theme:active { transform: scale(.94); }
.lg-theme:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
.lg-theme svg { width: 20px; height: 20px; }
@media (max-width: 640px) { .lg-theme { top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; } }

/* Світла тема входу — як вхід Порталу у світлій темі: світле бузкове тло, біла скляна картка, темний текст. Темна (вище) — як в Атласі й CRM. */
html:not(.dark) .lg-page { background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #eef2ff 100%); color: #111827; }
html:not(.dark) .lg-glow-1 { background: rgba(167, 139, 250, .32); }
html:not(.dark) .lg-glow-2 { background: rgba(129, 140, 248, .26); }
html:not(.dark) .lg-title-row h1 { color: #111827; }
html:not(.dark) .lg-sub { color: #6d28d9; }
html:not(.dark) .lg-card { background: rgba(255, 255, 255, .78); border-color: rgba(139, 92, 246, .2); box-shadow: 0 24px 64px -16px rgba(76, 29, 149, .28), 0 2px 8px rgba(76, 29, 149, .06); }
html:not(.dark) .lg-owl { opacity: .06; filter: grayscale(1); }
html:not(.dark) .lg-card-head h2 { color: #111827; }
html:not(.dark) .lg-card-head p { color: #6b7280; }
html:not(.dark) .lg-error { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
html:not(.dark) .lg-field label { color: #374151; }
html:not(.dark) .lg-input { background: #fff; border-color: rgba(148, 163, 184, .55); color: #111827; }
html:not(.dark) .lg-input:focus { border-color: transparent; box-shadow: inset 0 0 0 2px #8b5cf6; }
html:not(.dark) .lg-input:-webkit-autofill { -webkit-text-fill-color: #111827; -webkit-box-shadow: inset 0 0 0 40px #f5f3ff; caret-color: #111827; }
html:not(.dark) :is(.lg-btn, .lg-input):focus-visible { outline-color: #7c3aed; }
html:not(.dark) :is(.lg-foot-1, .lg-foot-2) { color: #4b5563; }
html:not(.dark) .lg-theme { background: rgba(255, 255, 255, .8); border-color: rgba(139, 92, 246, .25); color: #7c3aed; box-shadow: 0 4px 14px -6px rgba(76, 29, 149, .25); }
html:not(.dark) .lg-theme:hover { background: #fff; color: #6d28d9; }
html:not(.dark) .lg-theme:focus-visible { outline-color: #7c3aed; }

/* «Ворота» після входу: стулки з трикутниками розʼїжджаються по діагоналі (Атлас, CRM: #login-reveal) */
#login-reveal { position: fixed; inset: 0; z-index: 300; pointer-events: none; overflow: hidden; }
#login-reveal .rv { position: absolute; inset: -2px; background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 50%, #1e1b4b 100%); will-change: transform, opacity;
  transition: transform .9s cubic-bezier(.65, 0, .2, 1), opacity .55s ease .4s; }
#login-reveal .rv svg { position: absolute; inset: 0; width: 100%; height: 100%; }
#login-reveal .rv-left  { clip-path: polygon(0 0, 60% 0, 40% 100%, 0 100%); }
#login-reveal .rv-right { clip-path: polygon(60% 0, 100% 0, 100% 100%, 40% 100%); }
#login-reveal.rv-go .rv-left  { transform: translateX(-115%) rotate(-2deg); opacity: 0; }
#login-reveal.rv-go .rv-right { transform: translateX(115%) rotate(2deg); opacity: 0; }
html:not(.dark) #login-reveal .rv { background: linear-gradient(135deg, #f5f3ff 0%, #ddd6fe 50%, #f5f3ff 100%); }   /* у світлій темі — світлі стулки */
@media (prefers-reduced-motion: reduce) { #login-reveal { display: none; } }

/* Головна: шість плиток — по три в ряд на компʼютері (суми в гривнях довгі), по дві на телефоні */
@media (min-width: 1024px) { .pk-kpis.ts-kpi-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 641px) and (max-width: 1023px) { .pk-kpis.ts-kpi-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* на телефоні суми в гривнях менші й переносяться лише між числом і «грн» (групи цифр — нерозривні пробіли) */
@media (max-width: 640px) { .pk-kpis.ts-kpi-3 .pk-kpi-num { font-size: 20px; } }

/* ───────────── 10. Малі «мʼякі» кнопки дій (гайдбук, розділ 10): пастельні сині / зелені / фіолетові → один фіолетовий; червоні лишаються червоними ───────────── */
#main-content button:is(.bg-blue-50, .bg-blue-100, .bg-emerald-50, .bg-emerald-100, .bg-green-50, .bg-green-100, .bg-purple-50, .bg-purple-100, .bg-indigo-50, .bg-indigo-100):not(.pt-tabs > *, .ts-raw) {
  background-color: rgba(139, 92, 246, .12) !important; color: #6d28d9 !important; border-color: transparent !important; transition: background-color .15s, transform .12s; }
#main-content button:is(.bg-blue-50, .bg-blue-100, .bg-emerald-50, .bg-emerald-100, .bg-green-50, .bg-green-100, .bg-purple-50, .bg-purple-100, .bg-indigo-50, .bg-indigo-100):not(.pt-tabs > *, .ts-raw):hover { background-color: rgba(139, 92, 246, .2) !important; }
html.dark #main-content button:is(.bg-blue-50, .bg-blue-100, .bg-emerald-50, .bg-emerald-100, .bg-green-50, .bg-green-100, .bg-purple-50, .bg-purple-100, .bg-indigo-50, .bg-indigo-100, [class*="dark:bg-blue-900"], [class*="dark:bg-emerald-900"]):not(.pt-tabs > *, .ts-raw) {
  background-color: rgba(139, 92, 246, .22) !important; color: #ddd6fe !important; }
#main-content button:is(.bg-red-50, .bg-red-100) { color: #b91c1c; }
html.dark #main-content button:is(.bg-red-50, .bg-red-100) { color: #fca5a5; }

/* ───────────── 11. Вимикач анімацій людини (профіль → «Вигляд», клас fx-off) — разом із системним «менше руху» (гайдбук, розділ 20) ─────────────
   Нерухомий кадр, а не порожнє місце: анімації одразу стають у кінцевий стан. */
html.fx-off *, html.fx-off *::before, html.fx-off *::after { animation-duration: 0s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
  transition-duration: 0s !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { .animate-page-enter, .cascade-item { animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important; } }
/* перемикач у профілі */
.ts-switch { position: relative; flex-shrink: 0; width: 42px; height: 24px; border-radius: 999px; border: 0; background: rgba(148, 163, 184, .45); cursor: pointer; transition: background-color .2s; }
.ts-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.ts-switch[aria-checked="true"] { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.ts-switch[aria-checked="true"]::after { transform: translateX(18px); }
.ts-switch:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 2px; }

/* Кнопки, перемикачі й лічильники праворуч у шапці розділу — плитка, як лупа й дзвіночок (Артьом 19.11, обовʼязково;
   /Users/Shared/fregat-ui-kit/header-actions/README.md, першоджерело — CRM 14e7b59). Висота 40, радіус 12, тло з розмиттям і межа — як у лупи;
   текст 600 #7e22ce (темна #d8b4fe); лічильник — число основним кольором, «гаряче» — червоним; увімкнений перемикач — мʼяка фіолетова заливка.
   Головна дія (фіолетова) і небезпечна — як були. Колір тла — лише background-color: у списку-плитки стрілка лежить у background-image. */
#main-content .ts-tile { height: 40px; min-height: 40px; padding: 0 14px; border-radius: 12px; gap: 6px; font-size: 14px; font-weight: 600; line-height: 1;
  color: #7e22ce; background-color: rgba(255, 255, 255, .7); border: 1px solid #f3e8ff; box-shadow: none; cursor: pointer; white-space: nowrap;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background-color .2s, transform .2s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s; }
html.dark #main-content .ts-tile { color: #d8b4fe; background-color: rgba(31, 41, 55, .7); border-color: rgba(107, 33, 168, .5); }
/* наведення — лише для миші (гайдбук 0.4.6): на телефоні після дотику «наведення» залипає */
@media (hover: hover) {
  #main-content .ts-tile:not(.ts-tile-count):hover { background-color: #faf5ff; transform: scale(1.05); animation: tileRing 1.4s ease-out infinite; }
  html.dark #main-content .ts-tile:not(.ts-tile-count):hover { background-color: rgba(88, 28, 135, .4); }
}
#main-content .ts-tile:not(.ts-tile-count):active { transform: scale(.94); transition-duration: .08s; }
#main-content .ts-tile:focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; }
#main-content .ts-tile svg { width: 18px; height: 18px; flex-shrink: 0; }
#main-content .ts-tile.ts-tile-on, #main-content .ts-tile.ts-tile-on:hover { color: #6b21a8; background-color: #f3e8ff; border-color: #d8b4fe; }
html.dark #main-content .ts-tile.ts-tile-on, html.dark #main-content .ts-tile.ts-tile-on:hover { color: #f3e8ff; background-color: rgba(88, 28, 135, .55); border-color: rgba(192, 132, 252, .6); }
#main-content .ts-tile-count { cursor: default; }
#main-content .ts-tile-count b { color: #111827; font-weight: 700; }
html.dark #main-content .ts-tile-count b { color: #f9fafb; }
#main-content .ts-tile-count b.ts-hot { color: #b91c1c; }
html.dark #main-content .ts-tile-count b.ts-hot { color: #f87171; }
#main-content select.ts-tile { -webkit-appearance: none; appearance: none; padding-right: 36px; background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237e22ce' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
html.dark #main-content select.ts-tile { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d8b4fe' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
html.dark #main-content select.ts-tile option { color: #f9fafb; background: #1f2937; }
@keyframes tileRing { 0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, .45); } 100% { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0); } }
@media (prefers-reduced-motion: reduce) { #main-content .ts-tile { animation: none !important; transform: none !important; } }
html.fx-off #main-content .ts-tile { animation: none !important; transform: none !important; }

/* Поля й кнопки поруч із ними — однакова висота 40 px, як плитки й лупа (Артьом 19.11: «разная высота тоже поправить надо»;
   в Аналітиці поле дати було 36–52 px, списки 33, кнопки 32–34). Safari малює поле дати вищим — тому висота явна.
   Не чіпаємо таблиці, галочки, повзунки; великі поля за потреби — клас .ts-tall. */
#main-content :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]), select):not(.ts-raw):not(.ts-tall):not(table *) {
  height: 40px; box-sizing: border-box; padding-top: 0 !important; padding-bottom: 0 !important; line-height: normal; }
#main-content input[type="date"]:not(.ts-raw):not(table *) { -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; }
#main-content :is(div, form, section, label):has(> :is(input, select):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), > div > :is(input, select):not([type="checkbox"]):not([type="radio"]):not([type="hidden"])) > button:not(.ts-tile):not(table *) {
  height: 40px; box-sizing: border-box; padding-top: 0 !important; padding-bottom: 0 !important; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* Заголовок картки всередині розділу — 19 px / 700 (гайдбук, розділ 2; typography/README.md, розділ 3) */
#main-content .ts-card-title { font-size: 19px; font-weight: 700; line-height: 1.3; letter-spacing: -.005em; }

/* ───────────── 13. Вікно «Мій профіль» — як в Атласі (/Users/Shared/fregat-ui-kit/profile-window/README.md, Артьом 19.11) ─────────────
   Затемнення rgba(0,0,0,.5); вікно до 448 px, радіус 16, поле 24, межа; шапка — аватарка 56, імʼя 18/700, «Роль · логін»;
   картки: поле 12, радіус 12, межа; кнопка дії 12 px з межею; «Вигляд» розгорнута, значення фіолетові. */
.pfw-back { position: fixed; inset: 0; z-index: 12500; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .5); animation: pfwFade .18s ease both; }
.pfw { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 448px; max-height: calc(100vh - 32px); box-sizing: border-box; padding: 24px;
  border-radius: 16px; border: 1px solid #e5e7eb; background: #fff; color: #1f2937; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25); outline: none; animation: pfwIn .22s cubic-bezier(.2, .8, .2, 1) both; }
html.dark .pfw { background: #1f2937; border-color: #374151; color: #fff; }
.pfw-x { position: absolute; top: 16px; right: 16px; padding: 6px; border: 0; border-radius: 8px; background: none; color: #6b7280; cursor: pointer; line-height: 0; }
.pfw-x svg { width: 20px; height: 20px; }
.pfw-x:hover { background: #f3f4f6; }
html.dark .pfw-x { color: #9ca3af; } html.dark .pfw-x:hover { background: #374151; }
.pfw-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-right: 36px; }
.pfw-av { flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f3e8ff; font-size: 30px; line-height: 1; }
.pfw-av.pfw-ini { font-size: 18px; font-weight: 700; color: #7e22ce; }
html.dark .pfw-av { background: rgba(88, 28, 135, .4); } html.dark .pfw-av.pfw-ini { color: #d8b4fe; }
.pfw-tx { min-width: 0; }
.pfw-name { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.dark .pfw-name { color: #fff; }
.pfw-role { margin: 2px 0 0; font-size: 14px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.dark .pfw-role { color: #9ca3af; }
.pfw-role code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.pfw-list { display: flex; flex-direction: column; gap: 10px; max-height: 68vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px 4px; }
.pfw-card { padding: 12px; border-radius: 12px; border: 1px solid #e5e7eb; }
html.dark .pfw-card { border-color: #374151; }
.pfw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pfw-t { font-size: 14px; font-weight: 600; color: #1f2937; } html.dark .pfw-t { color: #fff; }
.pfw-s { margin-top: 1px; font-size: 12px; color: #6b7280; } html.dark .pfw-s { color: #9ca3af; }
/* кнопка дії — ЗАВЖДИ із заливкою (Артьом 19.11: сама межа #d1d5db — 1,47, кнопку не видно як кнопку) */
.pfw-btn { flex-shrink: 0; padding: 6px 10px; border-radius: 8px; border: 1px solid #d1d5db; background: #f3f4f6; color: #374151; font: inherit; font-size: 12px; cursor: pointer; }
.pfw-btn:hover { background: #e5e7eb; }
html.dark .pfw-btn { border-color: #4b5563; background: rgba(55, 65, 81, .6); color: #e5e7eb; } html.dark .pfw-btn:hover { background: #374151; }
.pfw-card.pfw-must { border-color: #fde68a; background: rgba(255, 251, 235, .6); }                  /* пароль видав адміністратор — нагадування */
html.dark .pfw-card.pfw-must { border-color: rgba(146, 64, 14, .5); background: rgba(120, 53, 15, .1); }
.pfw-body { margin-top: 12px; } .pfw-body[hidden] { display: none; }
.pfw-form { display: flex; flex-direction: column; gap: 8px; }
.pfw-in { box-sizing: border-box; width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid #d1d5db; background: #fff; color: #1f2937; font: inherit; font-size: 14px; outline: none; }
.pfw-in:focus { border-color: transparent; box-shadow: 0 0 0 2px #c084fc; }
html.dark .pfw-in { border-color: #4b5563; background: #111827; color: #f3f4f6; }
.pfw-hint { margin: 0; font-size: 11px; line-height: 1.4; color: #6b7280; } html.dark .pfw-hint { color: #9ca3af; }
.pfw-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pfw-primary { padding: 6px 12px; border: 0; border-radius: 8px; background: #7c3aed; color: #fff; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.pfw-primary:hover { background: #6d28d9; } .pfw-primary:disabled { opacity: .6; cursor: default; }
.pfw-err { font-size: 12px; color: #b91c1c; } html.dark .pfw-err { color: #f87171; }
.pfw-cat { display: flex; flex-direction: column; gap: 12px; max-height: 40vh; overflow-y: auto; margin: 0 -6px; padding: 6px; }
.pfw-gl { margin-bottom: 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; }
html.dark .pfw-gl { color: #9ca3af; }
.pfw-emos { display: flex; flex-wrap: wrap; gap: 6px; }
.pfw-emo { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: #f3f4f6; font-size: 20px; line-height: 1; cursor: pointer; transition: transform .15s; }
html.dark .pfw-emo { background: rgba(55, 65, 81, .6); }
.pfw-emo.pfw-on { box-shadow: 0 0 0 2px #a855f7; }
.pfw-looks { display: flex; flex-direction: column; gap: 6px; }
.pfw-look { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid #e5e7eb; background: none;
  color: #374151; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
html.dark .pfw-look { border-color: #374151; color: #e5e7eb; }
.pfw-look b { font-size: 12px; font-weight: 500; color: #7e22ce; } html.dark .pfw-look b { color: #d8b4fe; }
.pfw-sg { margin-bottom: 8px; }
.pfw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pfw-chip { padding: 4px 8px; border-radius: 8px; background: #f3f4f6; color: #374151; font-size: 12px; text-decoration: none; }
html.dark .pfw-chip { background: rgba(55, 65, 81, .6); color: #e5e7eb; }
.pfw-foot { margin: 4px 0 0; font-size: 11px; color: #6b7280; } html.dark .pfw-foot { color: #9ca3af; }
@media (hover: hover) {
  .pfw-emo:hover { transform: scale(1.1); }
  .pfw-look:hover { background: #f9fafb; } html.dark .pfw-look:hover { background: rgba(55, 65, 81, .5); }
  .pfw-chip:hover { background: #f3e8ff; } html.dark .pfw-chip:hover { background: rgba(88, 28, 135, .4); }
}
@keyframes pfwFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pfwIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pfw-back, .pfw { animation: none; } }
html.fx-off .pfw-back, html.fx-off .pfw { animation: none; }

/* ───────────── 12. Плашка «оновлено — оновіть сторінку» (стандарт Атласа, update-notice) ─────────────
   Внизу по центру, над усім; на телефоні — угорі (унизу помічник). Однакова в обох темах. */
#app-update { position: fixed; z-index: 14000; left: 50%; bottom: 16px; transform: translateX(-50%); max-width: calc(100vw - 32px); width: max-content;
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 16px; background: #6d28d9; color: #fff; font-size: 14px; line-height: 1.4;
  box-shadow: 0 24px 70px -20px rgba(20, 10, 50, .55), 0 6px 18px -6px rgba(76, 29, 149, .5); animation: appUpd .35s cubic-bezier(.2, .8, .2, 1) both; }
#app-update button { flex-shrink: 0; border: 0; border-radius: 12px; background: #fff; color: #5b21b6; font: inherit; font-weight: 700; padding: 7px 14px; cursor: pointer; }
#app-update button:hover { background: #f5f3ff; }
#app-update button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@keyframes appUpd { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%); } }
@media (max-width: 640px) { #app-update { bottom: auto; top: calc(64px + env(safe-area-inset-top, 0px)); width: auto; left: 16px; right: 16px; transform: none; max-width: none; animation: none; } }
@media (prefers-reduced-motion: reduce) { #app-update { animation: none; } }
html.fx-off #app-update { animation: none; }
