/* ds-v2-font: Inter cyrillic+latin, один URL на все сервисы, font-display: swap */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/portal-embed/fonts/inter-cyrillic-400-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/portal-embed/fonts/inter-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/portal-embed/fonts/inter-cyrillic-500-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/portal-embed/fonts/inter-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/portal-embed/fonts/inter-cyrillic-600-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/portal-embed/fonts/inter-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(/portal-embed/fonts/inter-cyrillic-700-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(/portal-embed/fonts/inter-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ds-v2 tokens. Поздний :root сервиса переопределяет те же имена; новые (--accent-fill, --sp-*) остаются. */
:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg-raised: #ffffff;
  --accent-fill: #0f766e;
  --accent-fill-hover: #115e59;
  --accent-text: #0f766e;
  --on-accent: #ffffff;
  --success-text: #047857;
  --success-soft: rgba(5, 150, 105, 0.12);
  --warning-soft: rgba(180, 83, 9, 0.12);
  --error-soft: rgba(220, 38, 38, 0.10);
  --info-soft: #e0f2fe;
  --focus: 0 0 0 3px rgba(var(--accent-rgb), 0.38);
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-ui: 0.9375rem;
  --fs-body: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 1.875rem;
  --fs-3xl: 2.375rem;
  --fs-display: clamp(2.25rem, 5.2vw, 3.75rem);
  --lh-tight: 1.1;
  --lh-snug: 1.3;
  --lh-body: 1.6;
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-24: 6rem;
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;
  --e1: 0 1px 2px rgba(var(--shadow-rgb), 0.06);
  --e2: 0 1px 2px rgba(var(--shadow-rgb), 0.06), 0 8px 24px rgba(var(--accent-rgb), 0.08);
  --e3: 0 2px 6px rgba(var(--shadow-rgb), 0.08), 0 16px 40px rgba(var(--accent-rgb), 0.14);
  --e4: 0 8px 24px rgba(var(--shadow-rgb), 0.16), 0 32px 80px rgba(var(--shadow-rgb), 0.22);
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 360ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --uvi-topbar-h: 56px;
  --uvi-topbar-z: 50;
  --uvi-danger: #b91c1c;
  --uvi-danger-text: #b91c1c;
}
html[data-theme="dark"] {
  --bg-raised: #1a2630;
  --accent-fill: #2dd4bf;
  --accent-fill-hover: #5eead4;
  --accent-text: #5eead4;
  --on-accent: #04201d;
  --success-text: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warning-soft: rgba(251, 191, 36, 0.14);
  --error-soft: rgba(248, 113, 113, 0.14);
  --info-soft: rgba(34, 211, 238, 0.12);
  --focus: 0 0 0 3px rgba(var(--accent-rgb), 0.45);
  --e1: 0 1px 3px rgba(0, 0, 0, 0.4);
  --e2: 0 2px 8px rgba(0, 0, 0, 0.35), 0 8px 28px rgba(var(--accent-rgb), 0.12);
  --e3: 0 4px 12px rgba(0, 0, 0, 0.4), 0 16px 44px rgba(var(--accent-rgb), 0.18);
  --e4: 0 8px 24px rgba(0, 0, 0, 0.5), 0 32px 80px rgba(0, 0, 0, 0.6);
  --uvi-danger: #fca5a5;
  --uvi-danger-text: #fca5a5;
}
html { font-family: var(--font); }
@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 1ms; --dur-2: 1ms; --dur-3: 1ms; }
}

/* Призрак рельса до гидрации portal-sidebar. Снимается классом html.uvi-rail-ready. */

@view-transition {
  navigation: auto;
}

html.uvi-has-rail {
  --uvi-rail-w: 220px;
}

#uvi-rail-ghost {
  position: fixed;
  z-index: 40;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--uvi-rail-w);
  box-sizing: border-box;
  background: var(--bg-card, #ffffff);
  border-right: 1px solid var(--border, #c8ddd9);
  overflow: hidden;
  view-transition-name: uvi-rail;
}

html[data-theme="dark"] #uvi-rail-ghost {
  background: var(--bg-card, #111c24);
  border-right-color: var(--border, #22323a);
}

#uvi-rail-ghost .uvi-rail {
  view-transition-name: none;
}

html.uvi-rail-ready #uvi-rail-ghost {
  display: none;
}

html.uvi-rail-ready .uvi-rail {
  view-transition-name: uvi-rail;
}

html.uvi-has-rail:not(.uvi-rail-ready) #root,
html.uvi-rail-owned #root {
  padding-left: var(--uvi-rail-w);
  box-sizing: border-box;
}

/* Фиксированные оболочки игнорируют padding #root. */
html.uvi-has-rail:not(.uvi-rail-ready) .app-shell,
html.uvi-has-rail:not(.uvi-rail-ready) .doc-shell,
html.uvi-rail-owned .app-shell,
html.uvi-rail-owned .doc-shell {
  left: var(--uvi-rail-w);
}

html.uvi-rail-owned portal-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  overflow: visible;
  z-index: 40;
}

html.uvi-rail-owned .uvi-rail {
  position: fixed;
  left: 0;
  top: 0;
  height: 100dvh;
  z-index: 40;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 120ms;
  animation-timing-function: ease;
}

::view-transition-group(uvi-rail),
::view-transition-old(uvi-rail),
::view-transition-new(uvi-rail) {
  animation: none;
}

@media (max-width: 767px) {
  #uvi-rail-ghost { display: none; }
  html.uvi-has-rail:not(.uvi-rail-ready) #root,
  html.uvi-rail-owned #root { padding-left: 0; }
  html.uvi-rail-owned #root {
    padding-bottom: calc(3.4rem + env(safe-area-inset-bottom));
  }
  html.uvi-has-rail:not(.uvi-rail-ready) .app-shell,
  html.uvi-has-rail:not(.uvi-rail-ready) .doc-shell,
  html.uvi-rail-owned .app-shell,
  html.uvi-rail-owned .doc-shell { left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* Рабочий экран: не класть второй слой точек поверх фона. */
html[data-uvi-surface='work'] .chat-atmosphere { display: none !important; }

/* ——— Контролы оболочки. Старые .btn сервисов не перекрашиваем. ——— */

.uvi-link {
  color: var(--accent-text);
  text-decoration: none;
}
.uvi-link:hover { text-decoration: underline; }

.uvi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0 0.9rem;
  border-radius: var(--r-lg, 14px);
  border: 1px solid transparent;
  background: transparent;
  color: var(--accent-text);
  font: inherit;
  font-size: var(--fs-sm, 0.875rem);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.uvi-btn:focus-visible { box-shadow: var(--focus); outline: none; }
.uvi-btn--sm { min-height: 32px; padding: 0 0.7rem; font-size: var(--fs-xs, 0.75rem); }
.uvi-btn--lg { min-height: 44px; padding: 0 1.1rem; font-size: var(--fs-ui, 0.9375rem); }
.uvi-btn--primary {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--on-accent);
}
.uvi-btn--primary:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); color: var(--on-accent); }
.uvi-btn--secondary {
  background: transparent;
  border-color: var(--accent-fill);
  color: var(--accent-text);
}
.uvi-btn--secondary:hover { background: rgba(var(--accent-rgb, 15, 118, 110), 0.08); }
.uvi-btn--ghost { background: transparent; border-color: transparent; color: var(--accent-text); }
.uvi-btn--ghost:hover { background: rgba(var(--accent-rgb, 15, 118, 110), 0.1); }
.uvi-btn--danger {
  background: transparent;
  border-color: var(--uvi-danger);
  color: var(--uvi-danger-text);
}
.uvi-btn:disabled,
.uvi-btn.is-loading { opacity: 0.55; cursor: not-allowed; }
.uvi-btn.is-loading { cursor: wait; }
.uvi-btn.is-loading::before {
  content: '';
  width: 0.85em;
  height: 0.85em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: uvi-spin var(--dur-3, 360ms) linear infinite;
}
@keyframes uvi-spin { to { transform: rotate(360deg); } }

.uvi-seg {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  padding: 2px;
  gap: 2px;
  border: 1px solid var(--border, #c8ddd9);
  border-radius: var(--r-lg, 14px);
  background: var(--bg-raised, #fff);
  overflow-x: auto;
}
.uvi-seg__item {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted, #4a6b72);
  font: inherit;
  font-size: var(--fs-sm, 0.875rem);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.uvi-seg__item.is-active {
  background: var(--accent-fill);
  color: var(--on-accent);
}
.uvi-seg__item:focus-visible { box-shadow: var(--focus); outline: none; }

.uvi-field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.uvi-field__label { font-size: var(--fs-sm, 0.875rem); font-weight: 600; color: var(--text, #133239); }
.uvi-field__control {
  height: 40px;
  width: 100%;
  padding: 0 0.75rem;
  border: 1px solid var(--border, #c8ddd9);
  border-radius: var(--r-md, 10px);
  background: var(--bg-raised, #fff);
  color: var(--text, #133239);
  font: inherit;
  font-size: var(--fs-ui, 0.9375rem);
}
select.uvi-field__control {
  appearance: none;
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent-text) 50%), linear-gradient(135deg, var(--accent-text) 50%, transparent 50%);
  background-position: calc(100% - 14px) 18px, calc(100% - 8px) 18px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.uvi-field__control:focus-visible { box-shadow: var(--focus); outline: none; }
.uvi-field.is-invalid .uvi-field__control { border-color: var(--uvi-danger); }
.uvi-field__error { margin: 0; color: var(--uvi-danger-text); font-size: var(--fs-sm, 0.875rem); }

.uvi-chip {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 0.8rem;
  border-radius: var(--r-pill, 999px);
  border: 1px solid var(--border, #c8ddd9);
  background: var(--bg-raised, #fff);
  color: var(--text, #133239);
  font: inherit;
  font-size: var(--fs-sm, 0.875rem);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.uvi-chip.is-active { border-color: var(--accent-fill); color: var(--accent-text); }
.uvi-chip:focus-visible { box-shadow: var(--focus); outline: none; }

.uvi-page {
  width: min(960px, 100%);
  margin-inline: auto;
  padding: 1.25rem 1.25rem 2rem;
  box-sizing: border-box;
}
.uvi-page--app { width: 100%; max-width: none; }
.uvi-page--catalog { width: min(1200px, 100%); }
.uvi-page__head { margin: 0 0 1rem; }
.uvi-page__title {
  margin: 0 0 0.35rem;
  font-size: var(--fs-xl, 1.5rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: var(--lh-tight, 1.1);
  color: var(--text, #133239);
  text-wrap: balance;
}
.uvi-page__sub {
  margin: 0;
  font-size: var(--fs-ui, 0.9375rem);
  line-height: var(--lh-snug, 1.3);
  color: var(--text-muted, #4a6b72);
}

.uvi-subnav {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  border-bottom: 1px solid var(--border, #c8ddd9);
}
.uvi-subnav__item {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 14rem;
  height: 40px;
  padding: 0 0.75rem;
  display: inline-flex;
  align-items: center;
  color: var(--text-muted, #4a6b72);
  text-decoration: none;
  font-size: var(--fs-sm, 0.875rem);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
  border-bottom: 2px solid transparent;
}
.uvi-subnav__item.is-active {
  color: var(--accent-text);
  border-bottom-color: var(--accent-fill);
}
.uvi-subnav--side {
  flex-direction: column;
  width: 200px;
  overflow-x: hidden;
  border-bottom: 0;
  border-right: 1px solid var(--border, #c8ddd9);
}
.uvi-subnav--side .uvi-subnav__item {
  width: 100%;
  max-width: none;
  border-bottom: 0;
  border-left: 2px solid transparent;
}
.uvi-subnav--side .uvi-subnav__item.is-active { border-left-color: var(--accent-fill); }

.uvi-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: 36rem;
  padding: 1.5rem 0;
}
.uvi-empty__icon { color: var(--accent-text); }
.uvi-empty__title {
  margin: 0;
  font-size: var(--fs-lg, 1.25rem);
  font-weight: 650;
  text-wrap: balance;
  color: var(--text, #133239);
}
.uvi-empty__text { margin: 0; color: var(--text-muted, #4a6b72); text-wrap: balance; }

.uvi-skel {
  display: block;
  border-radius: var(--r-sm, 8px);
  background: color-mix(in srgb, var(--text, #133239) 8%, var(--bg-card, #fff));
  animation: uvi-skel 1.2s ease-in-out infinite;
}
.uvi-skel--line { height: 0.75rem; width: 100%; margin: 0.4rem 0; }
.uvi-skel--short { width: 55%; }
.uvi-skel--title { height: 1.4rem; width: 40%; margin-bottom: 0.6rem; }
.uvi-skel--card { height: 7rem; width: 100%; margin-top: 0.8rem; }
.page-skel .uvi-skel { margin-bottom: 0.45rem; }
@keyframes uvi-skel {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.uvi-banner {
  position: fixed;
  top: var(--uvi-topbar-h, 56px);
  left: var(--uvi-rail-w, 0px);
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-sizing: border-box;
  height: 40px;
  max-height: 40px;
  margin: 0;
  padding: 0 0.75rem;
  overflow: hidden;
  font-size: var(--fs-sm, 0.875rem);
  color: var(--text, #133239);
  background: var(--info-soft, #e0f2fe);
  z-index: 45;
}
.uvi-banner__text {
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uvi-banner__action,
.uvi-banner__close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.uvi-banner--warn { background: var(--warning-soft); }
.uvi-banner--error { background: var(--error-soft); }
.uvi-banner--success { background: var(--success-soft); }
.uvi-email-verify { top: var(--uvi-topbar-h, 56px); z-index: 49; }
.uvi-email-verify.uvi-email-verify--flow {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  width: 100%;
  height: 32px;
  max-height: 32px;
  z-index: 2;
}
/* Полоса портала уже в потоке: фиксированный дубль из embed не рисуем. */
body:has(.email-verify-banner) #uvi-email-verify { display: none; }

.uvi-toast {
  position: fixed;
  z-index: 60;
  left: calc(var(--uvi-rail-w, 0px) + 1rem);
  bottom: 1rem;
  max-width: min(24rem, calc(100vw - var(--uvi-rail-w, 0px) - 2rem));
}

.uvi-footer,
.site-footer.uvi-footer { padding: 0.35rem 1.25rem; color: var(--text-muted, #4a6b72); font-size: var(--fs-sm, 0.875rem); }
.uvi-footer__row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  align-items: center;
  margin: 0;
  line-height: 1.4;
}
.uvi-footer a {
  color: var(--accent-text);
  text-decoration: none;
  white-space: nowrap;
}
.uvi-footer a:hover { text-decoration: underline; }

.uvi-presence {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted, #94a3b8);
  box-shadow: 0 0 0 2px var(--bg-card, #fff);
}
.uvi-presence.is-on { background: #15956b; }

html[data-uvi-surface='work'] .uvi-num,
.uvi-num { font-variant-numeric: tabular-nums; }

@media (max-width: 767px) {
  .uvi-page { padding: 1rem; }
  .uvi-btn--primary:not(.uvi-btn--sm) { min-height: 44px; }
  .uvi-toast { left: 0.75rem; bottom: calc(3.4rem + env(safe-area-inset-bottom) + 0.75rem); }
  .uvi-banner { left: 0; }
  .uvi-footer__row { flex-wrap: wrap; justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .uvi-skel,
  .uvi-btn.is-loading::before { animation: none; }
}
