/* ??? Design tokens ?????????????????????????????????????????????????????????? */
:root {
  /* Primary ? violet */
  --c-primary:        #7C3AED;
  --c-primary-button: #7c3aed38;
  --c-primary-h:      #6D28D9;
  --c-primary-bg:     #F5F3FF;
  --c-primary-border: #DDD6FE;

  --c-danger:         #EF4444;
  --c-danger-h:       #DC2626;
  --c-danger-bg:      #FEF2F2;

  --c-success:        #16A34A;
  --c-success-bg:     #F0FDF4;

  --c-warning-bg:     #FFFBEB;
  --c-warning-border: #FCD34D;
  --c-warning-text:   #92400E;

  /* Neutral */
  --c-bg:             #F4F2F8;
  --c-surface:        #FFFFFF;
  --c-border:         #E5E7EB;
  --c-border-strong:  #D1D5DB;

  /* Text */
  --c-text:           #111827;
  --c-text-2:         #6B7280;
  --c-text-3:         #9CA3AF;

  /* Navigation bar (purple) */
  --c-nav-bg:         #6D28D9;
  --c-nav-text:       rgba(255, 255, 255, 0.95);
  --c-nav-text-muted: rgba(255, 255, 255, 0.60);
  --c-nav-hover:      rgba(255, 255, 255, 0.10);
  --c-nav-active:     rgba(255, 255, 255, 0.18);

  /* Radii */
  --radius-sm:   4px;
  --radius:      8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .05);
  --shadow:    0 1px 3px rgb(0 0 0 / .08), 0 1px 2px rgb(0 0 0 / .04);
  --shadow-md: 0 4px 8px rgb(0 0 0 / .07), 0 1px 3px rgb(0 0 0 / .04);
  --shadow-lg: 0 12px 24px rgb(0 0 0 / .09), 0 4px 8px rgb(0 0 0 / .04);

  /* Breakpoints (for reference in media queries) */
  --bp-sm: 640px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --shell-nav-width: 240px;
  --shell-nav-width-collapsed: 64px;
  --shell-nav-sticky-top: 56px;
  --shell-nav-viewport-height: calc(100vh - 56px);

  font-family: 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* ??? Reset ?????????????????????????????????????????????????????????????????? */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; padding: 0; }

/* ??? Typography ????????????????????????????????????????????????????????????? */
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.375rem; font-weight: 700; }
h2 { font-size: 0.9375rem; font-weight: 600; }
h3 { font-size: 0.875rem;  font-weight: 600; }
p  { margin: 0; }
a  { color: var(--c-primary); }

/* ??? Focus ?????????????????????????????????????????????????????????????????? */
:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* ??? App shell ?????????????????????????????????????????????????????????????? */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
}

/* Страница файла диска: без верхней app-nav — сайдбар/контент на всю высоту */
.app-shell--disk-file {
  --shell-nav-sticky-top: 0px;
  --shell-nav-viewport-height: 100vh;
  --shell-nav-viewport-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

.app-shell--disk-file .app-shell-body,
.app-shell--disk-file .shell-layout {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.app-shell--disk-file .shell-content--full-bleed {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  height: auto;
}

/* ??? Navigation bar (top, purple) ?????????????????????????????????????????? */
.app-nav {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  background: var(--c-nav-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.app-nav-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.app-nav-logo-text {
  font-size: 1rem;
  line-height: 1;
  letter-spacing: -0.025em;
  user-select: none;
  text-decoration: none;
}

.app-nav-logo-delta { font-weight: 800; color: #ffffff; }
.app-nav-logo-plan  { font-weight: 600; color: rgba(255, 255, 255, 0.70); }

.app-nav-spacer { flex: 1; }

/* ??? Body below nav ????????????????????????????????????????????????????????? */
.app-shell-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  max-width: none;
  width: 100%;
  margin: 0;
}

/* ??? Shell layout: sidebar + content ??????????????????????????????????????? */
.shell-layout {
  display: flex;
  gap: 0;
  align-items: stretch;
  flex: 1;
  min-height: var(--shell-nav-viewport-height);
  width: 100%;
}

/* ??? Sidebar (full-height rail, flush to viewport edges) ??????????????????? */
.shell-nav {
  flex-shrink: 0;
  width: var(--shell-nav-width);
  background: var(--c-surface);
  border: none;
  border-right: 1px solid var(--c-border);
  border-radius: 0;
  padding: 0.625rem 0.5rem 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: var(--shell-nav-sticky-top);
  align-self: stretch;
  min-height: var(--shell-nav-viewport-height);
  max-height: var(--shell-nav-viewport-height);
  overflow: hidden;
}

.shell-nav-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding-bottom: 0.375rem;
}

.shell-nav-footer {
  flex-shrink: 0;
  padding: 0.5rem;
  border-top: 1px solid var(--c-border);
  margin-top: auto;
}

.shell-nav-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.625rem;
  width: 100%;
  min-height: 40px;
  padding: 0.625rem 0.75rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--c-text-2);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.shell-nav-collapse-btn:hover {
  background: var(--c-primary-bg);
  color: var(--c-primary);
}

.shell-nav-collapse-btn svg {
  flex-shrink: 0;
}

.shell-nav--collapsed {
  width: var(--shell-nav-width-collapsed);
}

.shell-nav--collapsed .shell-nav-link {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.shell-nav--collapsed .shell-nav-link__label,
.shell-nav--collapsed .shell-nav-workspace,
.shell-nav--collapsed .shell-nav-separator,
.shell-nav--collapsed .shell-nav-section__label,
.shell-nav--collapsed .shell-nav-collapse-btn__label {
  display: none;
}

.shell-nav--collapsed .shell-nav-collapse-btn {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.shell-nav-items {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.shell-nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.125rem 0 0.25rem;
}

.shell-nav-section--disk {
  margin: 0.125rem 0.5rem;
  padding: 0.375rem 0.25rem 0.5rem;
  border-radius: var(--radius);
  background: var(--c-primary-bg, rgba(37, 99, 235, 0.08));
}

.shell-nav-section__label {
  padding: 0.375rem 0.75rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-primary, #2563eb);
}

.shell-nav-link--disk {
  font-weight: 600;
}

.shell-nav-separator {
  height: 1px;
  background: var(--c-border);
  margin: 6px 8px;
  opacity: 0.6;
}

.shell-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  color: var(--c-text-2);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
  min-height: 40px;
}

.shell-nav-link svg { flex-shrink: 0; }

.shell-nav-link:hover {
  background: var(--c-primary-bg);
  color: var(--c-primary);
}

.shell-nav-link.active {
  background: var(--c-primary-bg);
  color: var(--c-primary);
  font-weight: 600;
}

.shell-nav-workspace {
  padding: 0.625rem 0.75rem 0.375rem;
  border-top: 1px solid var(--c-border);
  margin-top: 0.25rem;
}

.workspace-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
  margin-bottom: 0.15rem;
}

.workspace-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--c-text-2);
}

/* ??? Content area ??????????????????????????????????????????????????????????? */
.shell-content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.sheets-runtime-home__lede {
  margin: 0.35rem 0 0;
  max-width: 42rem;
}

.sheets-runtime-home__panel {
  margin-top: 0.5rem;
}

.disk-page {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1rem;
  padding-bottom: 0.65rem;
}

.disk-page__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.disk-page__title {
  margin: 0;
  flex-shrink: 0;
  font-size: 1.625rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--c-text);
}

.disk-page__search {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.disk-page__top .disk-page__top-actions {
  margin-left: 0;
}

.disk-page__trash-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

@media (min-width: 640px) {
  .disk-page__top .disk-page__top-actions {
    margin-left: auto;
  }
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--c-bg, #f8f9fb);
}

.auth-page--loading {
  min-height: 100vh;
}

.auth-card {
  width: 100%;
  max-width: 22rem;
  padding: 2rem 1.75rem;
  border-radius: 12px;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border, #e5e7eb);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.auth-card__brand {
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.auth-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 500;
}

.auth-card__subtitle {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.auth-form__error {
  margin: 0;
  color: var(--c-danger, #b42318);
  font-size: 0.875rem;
}

.auth-form__submit {
  width: 100%;
  margin-top: 0.25rem;
}

.sheets-home__lede {
  margin: 0.35rem 0 0;
  max-width: 42rem;
}

.sheets-home__panel {
  margin-top: 0.5rem;
}

.sheets-home__create-error {
  margin: 0 0 0.75rem;
}

.sheets-home__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
}

.sheets-home__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sheets-home__list-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md, 8px);
  background: var(--c-surface, #fff);
}

.sheets-home__list-meta {
  font-size: 0.8125rem;
  white-space: nowrap;
}

.sheets-home__link {
  font-weight: 600;
  color: var(--c-text);
  text-decoration: none;
}

.sheets-home__link:hover {
  color: var(--c-primary);
  text-decoration: underline;
}

.sheets-page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(60vh, calc(100vh - 56px - 3rem));
}

.sheets-page-error {
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

/*
 * Основной способ включить full-bleed режим — явный класс из AppLayout
 * (не зависит от поддержки :has() в браузере, см. shell-content--full-bleed).
 * :has() ниже оставлен как доп. подстраховка для страниц, которые встраивают
 * FortuneSheetWorkspace без этого класса.
 *
 * ВАЖНО: высоту не задаём явно (ни `height: 100%`, ни `height: var(...)`).
 * .shell-layout — flex-row без явного height (только min-height), поэтому
 * % от его высоты резолвится как auto (CSS §10.5) — явный `height: 100%`
 * отключает `align-items: stretch` и .shell-content схлопывается по контенту
 * (проверено headless-браузером: было 198px вместо 844px). Без объявленного
 * height cross-size остаётся `auto`, и stretch родителя растягивает блок
 * до полной высоты — как у соседнего .shell-nav, у которого height вообще
 * не задан.
 */
.shell-content--full-bleed,
.shell-content:has(.manual-spreadsheet-workspace--immersive),
.shell-content:has(.manual-spreadsheet-workspace--embedded) {
  padding: 0;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ??? Mobile nav toggle (hidden on desktop) ?????????????????????????????????? */
.app-nav-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: var(--c-nav-text);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.app-nav-menu-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.shell-nav-backdrop {
  display: none;
  position: fixed;
  inset: 56px 0 0;
  z-index: 90;
  padding: 0;
  margin: 0;
  border: none;
  background: rgb(17 24 39 / 0.42);
  cursor: pointer;
  animation: shellBackdropIn 0.18s ease;
}

@keyframes shellBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ??? Company Context Selector (in nav, dark background) ????????????????????? */
.nav-company-selector {
  position: relative;
  flex-shrink: 0;
}

.nav-company-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.20);
  color: var(--c-nav-text);
  border-radius: var(--radius);
  padding: 0.35rem 0.75rem;
  font-size: 0.8375rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s, border-color 0.15s;
  max-width: 220px;
  letter-spacing: 0;
}

.nav-company-trigger:hover:not(:disabled),
.nav-company-trigger--open {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.30);
}

.nav-company-trigger:disabled {
  opacity: 0.8;
  cursor: default;
}

.nav-company-trigger--empty {
  color: var(--c-nav-text-muted);
  font-style: italic;
}

.nav-company-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-company-chevron {
  flex-shrink: 0;
  opacity: 0.65;
  transition: transform 0.2s;
  color: inherit;
}

.nav-company-trigger--open .nav-company-chevron {
  transform: rotate(180deg);
}

@keyframes navDropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.nav-company-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  animation: navDropdownIn 0.14s ease;
  transform-origin: top right;
}

.nav-company-list {
  padding: 0.375rem 0;
  max-height: 280px;
  overflow-y: auto;
}

.nav-company-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.875rem;
  background: none;
  border: none;
  color: var(--c-text);
  cursor: pointer;
  text-align: left;
  box-shadow: none;
  border-radius: 0;
  font-weight: 400;
  letter-spacing: 0;
  transition: background 0.1s;
}

.nav-company-item:hover:not(:disabled) {
  background: #F9FAFB;
  box-shadow: none;
}

.nav-company-item--active { background: #F4F4F5; }
.nav-company-item--active:hover:not(:disabled) { background: #EFEFEF; }

.nav-company-item-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.nav-company-item-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.nav-company-item-tax {
  font-size: 0.75rem;
  color: var(--c-text-3);
  line-height: 1.2;
}

.nav-company-check {
  flex-shrink: 0;
  color: var(--c-text-3);
}

.nav-company-empty {
  padding: 0.75rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--c-text-3);
  text-align: center;
}

/* ??? Section / card ????????????????????????????????????????????????????????? */
section {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

section:last-child { margin-bottom: 0; }

/* ??? Section header (title row + action button) ????????????????????????????? */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--c-border);
}

.section-header h2 { padding: 0; margin: 0; border: none; }

.wizard-header-card {
  padding: 0.9rem 1.25rem 0.8rem;
}

.wizard-header-card .section-header {
  padding-bottom: 0.6rem;
  margin-bottom: 0.55rem;
}

.wizard-header-card .table-setup-progress {
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.wizard-header-card .table-setup-progress__track {
  gap: 0.35rem 0.6rem;
}

.wizard-header-card .table-setup-progress__item {
  padding: 0.15rem 0.4rem;
}

/* ??? Buttons ???????????????????????????????????????????????????????????????? */
/*
 * ????? ?????????? (??. docs/ui-guidelines.md �7):
 *   ? ??????? <button> ? neutral/secondary look. Primary ?? ??????????? ?? ?????????.
 *   ? Primary CTA ? ?????? ????? ????? ????? .btn-primary (1 ?? ??????/????).
 *   ? Toolbar/modal/control buttons ? .btn-toolbar (??? ?????????????????? ?????,
 *     ???????????? ?????????? button ????? `button.?`).
 *   ? .btn-sm ? ?????? ??????, ?? ?????????? ???.
 */
button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.475rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-border-strong);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--shadow-sm);
  min-height: 33px;
}

button:hover:not(:disabled) {
  background: var(--c-bg);
  border-color: var(--c-text-3);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/*
 * Primary CTA. ??????? a.btn-primary, ????? submit-?????? ????? ? `<a>`-??????
 * ????????? ?????????.
 */
button.btn-primary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}

button.btn-primary:hover:not(:disabled) {
  background: var(--c-primary-h);
  border-color: var(--c-primary-h);
}

/* .btn-secondary ????????? ? ??????? button ????? ?????????????, ?? ???????? ???
 * ???????????? ????? ????? ? ????? ??????? ?????? ?????????? ??? ?????? ??????
 * <button>. */
.btn-secondary {
  background: var(--c-surface);
  border-color: var(--c-border-strong);
  color: var(--c-text);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--c-bg);
  border-color: var(--c-text-3);
}

.btn-danger {
  background: var(--c-danger);
  border-color: var(--c-danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: var(--c-danger-h);
  border-color: var(--c-danger-h);
}

.btn-ghost {
  background: none;
  border-color: transparent;
  color: var(--c-primary);
  padding: 0;
  font-weight: 400;
  text-decoration: underline;
  text-decoration-color: transparent;
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  text-decoration-color: var(--c-primary);
  background: none;
  box-shadow: none;
}

/*
 * Soft toolbar/modal/control button. ????????? ?????? ? .twb-toolbar__btn ?
 * ??????????? ???-????????, ?????? ?????, ?????????? hover. ???????? ???
 * inline controls ? ????????, ???????? ? ?????????? ???????, ???
 * .btn-secondary ????????? ??????? �?????????�.
 */
.btn-toolbar {
  background: var(--c-bg);
  border-color: var(--c-border);
  color: var(--c-text);
  box-shadow: none;
}

.btn-toolbar:hover:not(:disabled) {
  background: var(--c-surface);
  border-color: var(--c-text-2);
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8125rem;
}

button.btn-sm,
a.btn-sm {
  min-height: 33px;
}

button svg,
a.btn-primary svg,
a.btn-secondary svg {
  flex-shrink: 0;
  display: block;
}

button.btn-sm:has(svg:only-child) {
  min-width: 38px;
  justify-content: center;
}

/* ??? Constructor table more menu ??????????????????????????????????????????? */
.constructor-table-more {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.constructor-table-more__menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 300;
  min-width: 13rem;
  padding: 0.35rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  box-shadow: var(--shadow-md);
}

.constructor-table-more__item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-text);
  box-shadow: none;
  font-size: 0.8125rem;
  font-weight: 400;
  text-align: left;
  text-decoration: none;
}

.constructor-table-more__item:hover:not(:disabled) {
  background: var(--c-bg);
  color: var(--c-text);
  text-decoration: none;
  box-shadow: none;
}

.constructor-table-more__item--danger {
  color: var(--c-danger);
}

.constructor-table-more__item--danger:hover:not(:disabled) {
  color: var(--c-danger-h);
  background: var(--c-danger-bg);
}

.constructor-table-more__confirm {
  display: grid;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  color: var(--c-danger);
  font-size: 0.8125rem;
}

.constructor-table-more__confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ?????? ??? ?????? (?????? ????????????, CTA) ? ?? ?? ???????, ??? ? button */
a.btn-primary,
a.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.475rem 1rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
  min-height: 33px;
}

a.btn-primary {
  border: 1px solid var(--c-primary);
  background: var(--c-primary);
  color: #fff;
}

a.btn-primary:hover {
  background: var(--c-primary-h);
  border-color: var(--c-primary-h);
  color: #fff;
  text-decoration: none;
}

a.btn-secondary {
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  color: var(--c-text);
}

a.btn-secondary:hover {
  background: var(--c-bg);
  border-color: var(--c-text-3);
  color: var(--c-text);
  text-decoration: none;
}

a.btn-primary.btn-sm,
a.btn-secondary.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8125rem;
}

.wizard-footer-nav {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* ??? Forms ?????????????????????????????????????????????????????????????????? */
label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-text-2);
  margin-bottom: 0;
  letter-spacing: 0.01em;
}

input, select { font: inherit; }

input,
select {
  width: 100%;
  max-width: 440px;
  padding: 0.45rem 0.75rem;
  margin-bottom: 0;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  /* ?????? ????: shorthand `background` ?????????? background-image/repeat ? ?????? chevron ? select */
  background-color: var(--c-surface);
  color: var(--c-text);
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgb(124 58 237 / .12);
}

select {
  appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 0.8125rem 0.8125rem;
  cursor: pointer;
}

select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237C3AED' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 0.8125rem 0.8125rem;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.create-company-actions {
  display: flex;
  gap: 0.5rem;
}

.create-company-actions .btn-primary,
.create-company-actions .btn-secondary {
  flex: 1;
}

.home-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.home-card-actions .btn-primary,
.home-card-actions .btn-secondary {
  flex: 1;
  justify-content: center;
  text-decoration: none;
}

.home-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.home-stat-card {
  margin-bottom: 0;
}

.home-stat-card__head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
}

.home-stat-card__head h2 {
  margin: 0;
}

.home-stat-card__icon {
  color: var(--c-primary);
  flex-shrink: 0;
}

.home-stat-card__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1;
  margin: 0 0 0.625rem;
}

.home-roadmap {
  margin-top: 1rem;
}

.home-roadmap__list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.home-roadmap__item {
  display: flex;
  gap: 0.75rem;
}

.home-roadmap__icon {
  color: var(--c-text-3);
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.home-roadmap__title {
  font-weight: 500;
  font-size: 0.875rem;
  margin: 0;
}

.home-roadmap__text {
  margin-top: 0.2rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  align-items: flex-end;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
}

/* Override max-width inside flex form rows */
.form-row .form-field input,
.form-row .form-field select { max-width: none; }

.form-error {
  font-size: 0.8125rem;
  color: var(--c-danger);
}

/* ??? Badges ????????????????????????????????????????????????????????????????? */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.175rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  line-height: 1.5;
}

.badge-active   { background: #DCFCE7; color: #15803D; }
.badge-neutral  { background: #F1F5F9; color: #64748B; }
.badge-danger   { background: #FEE2E2; color: #B91C1C; }
.badge-warning  { background: #FEF3C7; color: #92400E; }
.badge-wb       { background: #F5F3FF; color: #5B21B6; }
.badge-ozon     { background: #DBEAFE; color: #1E40AF; }

/* ??? Tables ????????????????????????????????????????????????????????????????? */
.table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8375rem;
  line-height: 1.4;
}

thead { background: var(--c-bg); }

th {
  text-align: left;
  padding: 0.55rem 0.875rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}

td {
  padding: 0.6rem 0.875rem;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--c-primary-bg); }

/* ??? Table setup progress (constructor wizard strip) ??????????????????????? */
.table-setup-progress {
  margin-bottom: 1rem;
  padding: 0.65rem 1rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}

.table-setup-progress__track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.table-setup-progress__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--c-text-2);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.table-setup-progress__item--done {
  color: var(--c-success);
}

.table-setup-progress__item--done .table-setup-progress__check {
  font-size: 0.65rem;
  font-weight: 700;
}

.table-setup-progress__item--current {
  color: var(--c-primary);
  background: var(--c-primary-bg);
  border-color: var(--c-primary-border);
}

.table-setup-progress__item--soon {
  color: var(--c-text-3);
  opacity: 0.9;
}

.table-setup-progress__soon {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--c-text-3);
  text-transform: uppercase;
}

.table-setup-progress__item--info {
  border-color: var(--c-border);
  background: var(--c-surface);
}

.table-setup-progress__item--with-hint {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}

.table-setup-progress__hint {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--c-text-3);
  line-height: 1.25;
  max-width: 12rem;
  white-space: normal;
}

/* Stage 3.9 ? ???????????? stepper */
.table-setup-progress__step-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-weight: 500;
  color: var(--c-primary);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.table-setup-progress__step-btn:hover:not(.table-setup-progress__step-btn--disabled) {
  text-decoration: underline;
}

.table-setup-progress__step-btn--active-route {
  text-decoration: underline;
}

.table-setup-progress__step-btn--disabled {
  color: var(--c-text-3);
  cursor: not-allowed;
  text-decoration: none;
}

.table-setup-progress__item--route-active:not(.table-setup-progress__item--current) {
  border-color: var(--c-border);
}

.table-setup-progress__label {
  white-space: nowrap;
}

/* ??? Publish readiness checklist (Stage 3.10i) ????????????????????????????? */
.publish-readiness {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}

.publish-readiness__title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.publish-readiness__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.publish-readiness__item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.publish-readiness__icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--c-text-3);
}

.publish-readiness__item--ok .publish-readiness__icon {
  color: var(--c-success);
}

.publish-readiness__item--warning .publish-readiness__icon {
  color: var(--c-warning, #b8860b);
}

.publish-readiness__item--missing .publish-readiness__icon {
  color: var(--c-danger);
}

.publish-readiness__label {
  font-size: 0.875rem;
  font-weight: 500;
}

.publish-readiness__detail {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.publish-readiness__hints {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.publish-readiness__block {
  margin: 0.75rem 0 0;
}

.load-horizon-note {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  background: var(--c-primary-bg);
  border: 1px solid var(--c-primary-border);
  border-radius: var(--radius-sm);
}

.td-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

/* ??? Spinner ???????????????????????????????????????????????????????????????? */
.spinner {
  display: inline-block;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
  vertical-align: middle;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

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

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 4rem 1rem;
  color: var(--c-text-3);
  font-size: 0.875rem;
}

/* ??? Empty state ???????????????????????????????????????????????????????????? */
.empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--c-text-3);
  font-size: 0.875rem;
}

.empty-state p + p { margin-top: 0.5rem; }

.disk-trash-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.disk-trash-empty p {
  margin: 0;
}

.disk-trash-empty__action {
  margin-top: 0.5rem;
}

/* Корзина: без внутренней рамки списка, строка на всю ширину панели (кнопки справа). */
.disk-trash-list.tables-fs-list {
  border: none;
  border-radius: 0;
  background: transparent;
  width: 100%;
  max-width: none;
}

.disk-trash-list .tables-fs-list__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.45rem 0;
  min-height: 0;
  border-bottom: 1px solid var(--c-border);
  border-radius: 0;
  background: transparent;
  gap: 0.75rem;
}

.disk-trash-list .tables-fs-list__row:first-child,
.disk-trash-list .tables-fs-list__row:last-child {
  border-radius: 0;
}

.disk-trash-list .tables-fs-list__row:last-child {
  border-bottom: none;
}

.disk-trash-list .tables-fs-list__open {
  gap: 0.4rem;
  align-items: center;
}

.disk-trash-list .tables-fs-list__title {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.25;
  color: #202124;
}

.disk-trash-list__meta {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  line-height: 1.25;
  color: #5f6368;
}

.disk-trash-list .tables-fs-list__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* Тонкая панель под список — меньше «карточной» высоты вокруг файла. */
.sheets-runtime-home__panel:has(.disk-trash-list) {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

/* ??? Error banner ??????????????????????????????????????????????????????????? */
.error-banner {
  padding: 0.75rem 1rem;
  background: var(--c-danger-bg);
  border: 1px solid #FECACA;
  border-radius: var(--radius);
  color: var(--c-danger);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ??? Utility ???????????????????????????????????????????????????????????????? */
.muted {
  color: var(--c-text-2);
  font-size: 0.8125rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--c-text-2);
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color 0.15s;
}

.back-link:hover { color: var(--c-primary); }

/* ??? Inline confirm ????????????????????????????????????????????????????????? */
.inline-confirm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--c-text-2);
}

/* ??? Info grid (detail pages) ??????????????????????????????????????????????? */
.info-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.625rem 1rem;
  font-size: 0.875rem;
}

.info-label {
  color: var(--c-text-3);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 0.1rem;
}

.info-value { color: var(--c-text); }

/* ??? Source info card (constructor) ???????????????????????????????????????? */
.source-info-card {
  padding: 0.75rem 1rem;
  background: var(--c-primary-bg);
  border: 1px solid var(--c-primary-border);
  border-radius: var(--radius);
  max-width: 440px;
}

/* ??? Source Picker (constructor, Stage 3.10a) ??????????????????????????????? */
.source-picker {
  display: grid;
  gap: 1rem;
  max-width: 900px;
}

.source-picker__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.source-picker__header h4 {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
}

.source-picker__groups {
  display: grid;
  gap: 1rem;
}

.source-picker__group {
  display: grid;
  gap: 0.6rem;
}

.source-picker__group-header h5 {
  margin: 0 0 0.15rem;
  color: var(--c-text);
  font-size: 0.8125rem;
  font-weight: 700;
}

.source-picker__group-header p {
  margin: 0;
  color: var(--c-text-2);
  font-size: 0.75rem;
}

.source-picker__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.65rem;
}

.source-picker-card {
  display: grid;
  gap: 0.35rem;
  width: 100%;
  min-height: 150px;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  color: inherit;
  font: inherit;
  text-align: left;
}

.source-picker-card--selectable {
  cursor: pointer;
}

.source-picker-card--selectable:hover {
  border-color: var(--c-primary-border);
}

.source-picker-card--active {
  border-color: var(--c-primary-border);
  background: var(--c-primary-bg);
}

.source-picker-card--disabled {
  opacity: 0.78;
}

.source-picker-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.source-picker-card__title {
  color: var(--c-text);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
}

.source-picker-card__subtitle {
  margin: 0;
  color: var(--c-text-3);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.source-picker-card__description {
  margin: 0;
  color: var(--c-text-2);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.source-picker-card__footer {
  align-self: end;
  color: var(--c-text-3);
  font-size: 0.75rem;
}

.source-picker-card__selected {
  color: var(--c-primary);
  font-weight: 700;
}

/* ??? Wizard source picker (??? �?????????�, two-level) ? ?? ?????? ? ???????? /constructor ? */
.wizard-source-picker {
  display: grid;
  gap: 0.75rem;
  width: 100%;
  max-width: 900px;
}

.wizard-source-picker__intro {
  display: grid;
  gap: 0.2rem;
}

.wizard-source-picker__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.wizard-source-picker__lede {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.wizard-source-picker__groups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: stretch;
}

button.wizard-source-picker__tab {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  padding: 0.42rem 0.62rem;
  min-height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--c-border-strong);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  white-space: normal;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
}

/* Hover ?????? ??? ??????????? ??????? ? ????? :hover ?????????? --active (???? ????????????? ? ?????????????) */
button.wizard-source-picker__tab:hover:not(:disabled):not(.wizard-source-picker__tab--active) {
  border-color: var(--c-primary-border);
  background: var(--c-bg);
  color: var(--c-text);
}

button.wizard-source-picker__tab--active {
  border-color: var(--c-primary-border);
  background: var(--c-primary-bg);
  color: var(--c-text);
}

button.wizard-source-picker__tab--active:hover:not(:disabled) {
  border-color: var(--c-primary-border);
  background: color-mix(in srgb, var(--c-primary-bg) 92%, var(--c-primary) 8%);
  color: var(--c-text);
}

.wizard-source-picker__tab-label {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.wizard-source-picker__tab-meta {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--c-text-3);
}

.wizard-source-picker__tab-meta--muted {
  font-style: italic;
}

.wizard-source-picker__panel {
  display: grid;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-bg);
}

/* ??? Wizard: radio-card ????? ?????? (????????? + ?????? + chevron) ? */

.wizard-source-radio-group {
  display: grid;
  gap: 0.32rem;
}

.wizard-source-radio-group__heading {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-3);
}

.wizard-source-radio-wrap {
  display: grid;
  gap: 0.28rem;
}

.wizard-source-radio {
  display: block;
  margin: 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
  min-width: 0;
}

.wizard-source-radio__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wizard-source-radio__surface {
  display: block;
  padding: clamp(0.26rem, 0.45vw, 0.34rem) clamp(0.38rem, 0.95vw, 0.5rem);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}

.wizard-source-radio:hover .wizard-source-radio__surface {
  border-color: var(--c-primary-border);
}

.wizard-source-radio--checked .wizard-source-radio__surface {
  border-color: var(--c-primary);
  border-width: 1px;
  background: var(--c-primary-bg);
  /* ???? ???????: ?? ??????????? ring ????? box-shadow ? ????? �???????� ????? */
  box-shadow: var(--shadow-sm);
}

/* ??????????: ?????? ?????? ??? :focus-visible ? radio, ?? ??? ????? ?? ??? ????????? ?????? */
.wizard-source-radio__input:focus-visible + .wizard-source-radio__surface {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.wizard-source-radio--checked:hover .wizard-source-radio__surface {
  border-color: var(--c-primary);
  background: color-mix(in srgb, var(--c-primary-bg) 88%, var(--c-primary) 12%);
}

.wizard-source-radio__line1 {
  display: flex;
  align-items: center;
  gap: clamp(0.22rem, 0.5vw, 0.32rem);
  flex-wrap: nowrap;
  min-width: 0;
  width: 100%;
  min-height: 0;
}

.wizard-source-radio__indicator {
  flex-shrink: 0;
  width: 0.75rem;
  height: 0.75rem;
  border: 1px solid var(--c-border-strong);
  border-radius: 50%;
  background: var(--c-surface);
  box-sizing: border-box;
  position: relative;
}

.wizard-source-radio--checked .wizard-source-radio__indicator {
  border-color: var(--c-primary);
  background: var(--c-primary-bg);
}

.wizard-source-radio--checked .wizard-source-radio__indicator::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: var(--c-primary);
}

.wizard-source-radio__title {
  flex: 0 0 auto;
  max-width: min(10.5rem, 32%);
  font-size: clamp(0.72rem, 0.35vw + 0.66rem, 0.78125rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ???? ?????????? ?????????? `button` / `button:hover` (primary), ??? ? ????????? ????????? */
button.wizard-source-radio__details-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  padding: 0.22rem;
  min-height: auto;
  min-width: auto;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-text-3);
  line-height: 0;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  cursor: pointer;
  box-shadow: none;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}

button.wizard-source-radio__details-toggle:hover:not(:disabled) {
  color: var(--c-text);
  background: var(--c-bg);
  border-color: var(--c-border-strong);
}

.wizard-source-radio--checked button.wizard-source-radio__details-toggle:hover:not(:disabled) {
  background: color-mix(in srgb, var(--c-primary-bg) 88%, var(--c-border) 12%);
  border-color: var(--c-primary-border);
  color: var(--c-text);
}

button.wizard-source-radio__details-toggle:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.wizard-source-radio__details-chevron {
  flex-shrink: 0;
  opacity: 0.65;
  transition: transform 0.2s;
  color: currentColor;
}

.wizard-source-radio__details-toggle--expanded .wizard-source-radio__details-chevron {
  transform: rotate(180deg);
}

.wizard-source-radio__chips-inline {
  display: flex;
  align-items: center;
  gap: clamp(0.2rem, 0.45vw, 0.32rem);
  flex: 1 1 0;
  min-width: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: thin;
  padding: 0.12rem 0.04rem;
  margin: -0.06rem 0;
}

.wizard-source-radio__chip-tile {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  flex-shrink: 0;
  padding: 0.16rem 0.38rem 0.16rem 0.3rem;
  border-radius: var(--radius-sm);
  font-size: clamp(0.6875rem, 0.28vw + 0.6rem, 0.71875rem);
  font-weight: 500;
  line-height: 1.28;
  color: var(--c-text-2);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  white-space: nowrap;
}

.wizard-source-radio--checked .wizard-source-radio__chip-tile {
  background: color-mix(in srgb, var(--c-surface) 75%, var(--c-primary-bg));
  border-color: var(--c-primary-border);
}

.wizard-source-radio__chip-icon {
  flex-shrink: 0;
  color: var(--c-text-3);
}

.wizard-source-radio--checked .wizard-source-radio__chip-icon {
  color: var(--c-primary-h);
}

.wizard-source-radio__chip-label {
  overflow-wrap: normal;
}

/* ????????? ???? */
.wizard-source-radio__details {
  margin: 0 0 0.15rem;
  padding: 0.55rem 0.65rem 0.6rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--c-surface) 88%, var(--c-bg));
  border-left: 3px solid var(--c-primary-border);
}

.wizard-source-radio__detail-block {
  margin-bottom: 0.55rem;
}

.wizard-source-radio__detail-block:last-child {
  margin-bottom: 0;
}

.wizard-source-radio__detail-title {
  margin: 0 0 0.22rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-3);
}

.wizard-source-radio__detail-text {
  margin: 0 0 0.28rem;
  font-size: 0.78rem;
  line-height: 1.42;
}

.wizard-source-radio__detail-text:last-child {
  margin-bottom: 0;
}

/* ??????????? ?????? ? ?????????? ??????, ??? radio */
.wizard-source-locked {
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--c-border);
}

.wizard-source-locked__heading {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-3);
  margin-bottom: 0.35rem;
}

.wizard-source-locked__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.wizard-source-locked__item {
  padding: 0.32rem 0.45rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--c-surface) 92%, var(--c-bg));
  opacity: 0.95;
}

.wizard-source-locked__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
}

.wizard-source-locked__title {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.wizard-source-locked__reason {
  margin: 0.18rem 0 0;
  font-size: 0.68rem;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ??? Constructor home (??????? / ?????????) ??????????????????????????????? */
.constructor-home {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

section.constructor-home__toolbar {
  margin: 0 0 0.75rem;
  padding: 0.85rem 1.25rem 0.95rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.constructor-home__toolbar-row {
  display: flex;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.constructor-home__toolbar-title {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--c-text);
  display: flex;
  align-items: center;
  min-height: 33px;
}

.constructor-home__tabs {
  margin-top: 0;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

/* ????????????? ????????: ?????????? ??????? (?????? + ?????), ???????? ?????? ?????? ????? */
.constructor-home__screen-tabs {
  flex: 0 1 auto;
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.125rem;
  padding: 3px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--c-bg) 90%, var(--c-border) 10%);
  border: 1px solid var(--c-border);
  box-sizing: border-box;
}

button.constructor-home__screen-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 0.65rem;
  min-height: 0;
  height: 27px;
  border: none;
  border-radius: calc(var(--radius-sm) + 1px);
  background: transparent;
  color: var(--c-text-2);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  box-shadow: none;
  font-family: inherit;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  box-sizing: border-box;
}

button.constructor-home__screen-tab:hover:not(:disabled) {
  background: color-mix(in srgb, var(--c-surface) 72%, transparent);
  color: var(--c-text);
}

button.constructor-home__screen-tab--active {
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: none;
}

button.constructor-home__screen-tab--active:hover:not(:disabled) {
  background: var(--c-surface);
  color: var(--c-text);
}

button.constructor-home__screen-tab:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 0;
}

.constructor-home__screen-tab-icon {
  flex-shrink: 0;
  opacity: 0.92;
}

.constructor-home__toolbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 33px;
  gap: 0.35rem;
  flex-shrink: 0;
}

.constructor-home__toolbar-error {
  margin: 0.35rem 0 0;
}

/* ?????? ??????? ? `section` ? ?????????? ?????? ???????? (????? ??? ?? --c-bg) */
section.constructor-home__panel {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.constructor-home__panel[hidden] {
  display: none !important;
}

.constructor-home__panel .constructor-home__tables-tree {
  margin-top: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.constructor-home__tables-panel-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.constructor-home__tables-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.constructor-home__panel .constructor-home-source-catalog {
  margin-top: 0;
}

.constructor-home__panel .wizard-source-picker {
  max-width: none;
}

.constructor-home__panel .error-banner {
  margin-bottom: 0;
}

.constructor-home__empty-create {
  margin-top: 0.75rem;
}

/* ??????? �?????????�: ??? ?? ?????????? ??????, ??? WizardSourcePicker (??? radio). */
.constructor-home-source-catalog .wizard-source-radio.constructor-home-source-catalog__method {
  cursor: default;
}

.constructor-home-source-catalog .wizard-source-radio__indicator {
  display: none;
}

.constructor-home-source-catalog .wizard-source-radio__title {
  max-width: min(15rem, 42vw);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.constructor-home-source-catalog .wizard-source-radio__line1 {
  font-size: 0.75rem;
}

.constructor-home-source-catalog .wizard-source-radio__chips-inline .wizard-source-radio__chip-tile {
  font-size: 0.6875rem;
  padding: 0.1rem 0.28rem 0.1rem 0.22rem;
  line-height: 1.22;
}

.constructor-home-source-catalog .wizard-source-radio__surface {
  padding: clamp(0.18rem, 0.35vw, 0.24rem) clamp(0.32rem, 0.75vw, 0.42rem);
}

.constructor-home-source-catalog__marketplace-empty {
  margin: 0.35rem 0 0;
}

.constructor-home-source-catalog__methods-heading {
  margin-bottom: 0.45rem;
}

.constructor-home-source-catalog__api-groups {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.constructor-home-source-catalog__api-group {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  padding: 0.35rem 0.45rem 0.45rem;
}

.constructor-home-source-catalog__api-group-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.35;
  list-style: none;
  padding: 0.12rem 0.2rem;
  user-select: none;
}

.constructor-home-source-catalog__api-group-summary::-webkit-details-marker {
  display: none;
}

.constructor-home-source-catalog__api-group-methods {
  margin-top: 0.35rem;
  padding-top: 0.15rem;
}

.constructor-home-source-catalog__draft-catalog-note {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.constructor-home-source-catalog__test-unavailable {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.add-source-method-modal__card {
  max-width: 26rem;
}

.add-source-method-modal__form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.add-source-method-modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8125rem;
}

.add-source-method-modal__field > span {
  font-weight: 600;
  color: var(--c-text-muted);
}

.add-source-method-modal__field input,
.add-source-method-modal__field select,
.add-source-method-modal__field textarea {
  font: inherit;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-bg);
  color: var(--c-text);
}

.add-source-method-modal__hint {
  margin: 0;
  font-size: 0.8125rem;
}

.add-source-method-modal__error {
  margin: 0;
  font-size: 0.8125rem;
}

.add-source-method-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--c-border);
}

/* ?? Add Method modal ??????????????????????????????????????????????????????? */

/* Wider card override for the modal */
.add-method-wizard__card {
  max-width: 38rem;
}

/* Form body */
.add-method-wizard__step-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.75rem;
}

.add-method-wizard__step-lede {
  margin: 0;
  font-size: 0.8125rem;
}

/* Fields */
.add-method-wizard__field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8125rem;
}

.add-method-wizard__label {
  font-weight: 600;
  color: var(--c-text-2);
}

.add-method-wizard__required {
  color: var(--c-danger);
  margin-left: 0.1rem;
}

.add-method-wizard__input,
.add-method-wizard__select {
  font: inherit;
  font-size: 0.8125rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  /* ?? `background` shorthand ? ????? ???????????? chevron ??????????? `select` */
  background-color: var(--c-bg);
  color: var(--c-text);
  width: 100%;
}

/* ?????????? padding ?? ?????? ??????? ?????? ??? SVG-chevron ??????????? `select` */
.add-method-wizard__select {
  padding-right: 2.25rem;
}

/* Marketplace chip selector */
.add-method-wizard__mp-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.add-method-wizard__mp-chip {
  font: inherit;
  font-size: 0.8125rem;
  padding: 0.3rem 0.7rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text-2);
  cursor: pointer;
  transition: border-color 0.1s, color 0.1s, background 0.1s;
}

.add-method-wizard__mp-chip:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.add-method-wizard__mp-chip--active {
  border-color: var(--c-primary);
  background: var(--c-primary-bg);
  color: var(--c-primary);
  font-weight: 600;
}

/* Sticky footer actions */
.add-method-wizard__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.5rem;
  margin-top: 0.15rem;
  border-top: 1px solid var(--c-border);
  position: sticky;
  bottom: 0;
  background: var(--c-surface);
  padding-bottom: 0.1rem;
  z-index: 1;
}

.add-method-wizard__error {
  margin: 0;
  font-size: 0.8125rem;
}

/* ?? field-hint ? general helper text below form fields ???????????????????? */

.field-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--c-text-3);
  line-height: 1.35;
}

.constructor-home-source-catalog__badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  padding: 0.12rem 0.38rem;
  line-height: 1.2;
}

/* Right-side action area: ? menu + drawer chevron grouped together */
.constructor-home-source-catalog__row-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.1rem;
}

/* Per-method ? menu anchor (no auto-margin ? handled by __row-actions) */
.constructor-home-source-catalog__method-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.constructor-home-source-catalog__edit-open {
  /* margin-left now handled by __row-actions container */
}

.wizard-source-radio-wrap--open {
  gap: 0;
  border-left: 2px solid var(--c-primary);
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius);
}

.wizard-source-radio--editing .wizard-source-radio__surface {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-color: var(--c-primary-border);
  border-bottom-color: transparent;
  background: var(--c-surface);
}

.constructor-home-source-catalog__group-empty {
  padding: 0.5rem 0.65rem;
  font-size: 0.75rem;
  color: var(--c-text-3);
}

.constructor-home-source-catalog__drawer {
  margin-top: 1rem;
  padding: 1.1rem 1.25rem 1.15rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
}

.wizard-source-radio-wrap .constructor-home-source-catalog__drawer.constructor-home-source-catalog__drawer--nested {
  margin-top: 0.65rem;
  padding: 0.68rem 0.82rem 0.72rem;
  font-size: 0.9375rem;
  line-height: 1.38;
}

.wizard-source-radio-wrap--open .constructor-home-source-catalog__drawer.constructor-home-source-catalog__drawer--nested {
  margin-top: 0;
  border-top: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-color: var(--c-primary-border);
  border-left-color: var(--c-primary-border);
  border-right-color: var(--c-primary-border);
}

/* ?????????? drawer: ??????? ?? ????????? (~20?30%), ???? ?????? ????????; ?????? ?????? ???? ???????? ?????? */
.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__drawer-header {
  margin-bottom: 0.5rem;
  padding-bottom: 0.42rem;
  gap: 0.4rem 0.55rem;
}

.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__drawer-layout {
  gap: 0.55rem;
}

.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__drawer-alerts {
  gap: 0.35rem;
}

.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__drawer-section.constructor-home-source-catalog__section {
  gap: 0.55rem;
}

.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__drawer-section > .constructor-home-source-catalog__section-title {
  padding: 0 0 0.32rem;
  font-size: 0.8125rem;
}

.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__drawer-section .constructor-home-source-catalog__field {
  gap: 0.22rem;
}

.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__field > span {
  font-size: 0.76rem;
}

.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__field input,
.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__field textarea,
.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__field select {
  padding: 0.32rem 0.55rem;
  font-size: 0.875rem;
}

.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__field select {
  padding-right: 2.25rem;
}

.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__field textarea {
  min-height: 3.1rem;
}

.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__drawer-section .constructor-home-source-catalog__runtime-grid {
  gap: 0.5rem;
}

.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__drawer-section .constructor-home-source-catalog__runtime-grid--compact {
  gap: 0.32rem;
}

.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__readiness-scroll {
  max-height: 11rem;
  padding: 0.4rem 0.5rem;
}

.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__readiness,
.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__banner,
.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__error {
  font-size: 0.76rem;
}

.wizard-source-radio-wrap .constructor-home-source-catalog__drawer--nested .constructor-home-source-catalog__publish-note {
  font-size: 0.76rem;
}

.constructor-home-source-catalog__drawer-inner {
  min-width: 0;
}

.constructor-home-source-catalog__drawer-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--c-border);
  min-width: 0;
}

.source-method-roadmap {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  flex-shrink: 0;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--c-text-3);
  white-space: nowrap;
}

.source-method-roadmap--done {
  color: #16a34a;
  font-weight: 500;
}

.source-method-roadmap__sep {
  color: var(--c-text-3);
  font-size: 0.65rem;
}

.source-method-roadmap__step {
  color: var(--c-text-3);
}

.source-method-roadmap__step--active {
  color: var(--c-primary);
  font-weight: 600;
}

.source-method-roadmap__step--done {
  color: var(--c-text-2);
}


.constructor-home-source-catalog__drawer-helper {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.constructor-home-source-catalog__drawer-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  flex: 1 1 auto;
  justify-content: flex-start;
  min-width: 0;
}

.constructor-home-source-catalog__drawer-header-actions .constructor-home-source-catalog__drawer-actions-spacer {
  flex: 1 1 auto;
  min-width: 0.75rem;
}

.constructor-home-source-catalog__drawer-header-trail {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  flex-shrink: 0;
}

button.constructor-home__icon-link.constructor-home-source-catalog__save-icon-btn {
  border: 1px solid var(--c-border-strong);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}

button.constructor-home__icon-link.constructor-home-source-catalog__save-icon-btn:hover:not(:disabled) {
  background: var(--c-bg);
  border-color: var(--c-text-3);
}

button.constructor-home__icon-link.constructor-home-source-catalog__save-icon-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

button.constructor-home__icon-link.constructor-home-source-catalog__discard-icon-btn {
  color: var(--c-text-2);
}

button.constructor-home__icon-link.constructor-home-source-catalog__discard-icon-btn:hover:not(:disabled) {
  background: var(--c-bg);
  color: var(--c-text);
}

button.constructor-home__icon-link.constructor-home-source-catalog__discard-icon-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.constructor-home-source-catalog__drawer-header-actions .constructor-home-source-catalog__publish-note {
  flex: 0 0 auto;
  max-width: none;
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.constructor-home-source-catalog__drawer-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-text);
  letter-spacing: 0.01em;
}

.constructor-home-source-catalog__drawer-layout {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.constructor-home-source-catalog__drawer-alerts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.constructor-home-source-catalog__readiness-scroll {
  max-height: 15rem;
  overflow-y: auto;
  padding: 0.55rem 0.65rem;
  margin-top: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg);
}

.constructor-home-source-catalog__readiness-scroll .constructor-home-source-catalog__readiness {
  margin-top: 0;
}

/* ??? Source Method editor: tab bar ? segmented switch (same pattern as Constructor screen tabs) ??? */
.source-method-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  align-items: center;
  gap: 0.125rem;
  padding: 3px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--c-bg) 90%, var(--c-border) 10%);
  border: 1px solid var(--c-border);
  box-sizing: border-box;
  margin-bottom: 0;
}

.source-method-tabs::-webkit-scrollbar {
  display: none;
}

.source-method-tabs__tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.65rem;
  min-height: 0;
  height: 27px;
  border: none;
  border-radius: calc(var(--radius-sm) + 1px);
  background: transparent;
  color: var(--c-text-2);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  box-shadow: none;
  font-family: inherit;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
  box-sizing: border-box;
}

.source-method-tabs__tab:hover:not(:disabled) {
  background: color-mix(in srgb, var(--c-surface) 72%, transparent);
  color: var(--c-text);
}

.source-method-tabs__tab--active {
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: none;
}

.source-method-tabs__tab--active:hover:not(:disabled) {
  background: var(--c-surface);
  color: var(--c-text);
}

.source-method-tabs__tab:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 0;
}

/* ??? Source Method editor: compact preset/template list ? dropdown pattern ? */
.source-method-preset-details {
  position: relative;
}

.source-method-preset-details > summary.source-method-preset-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.32rem 0.6rem 0.32rem 0.55rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--c-text-2);
  cursor: pointer;
  user-select: none;
  list-style: none;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  transition: border-color 0.12s, color 0.12s;
}

details[open].source-method-preset-details > summary.source-method-preset-summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
  background: var(--c-surface);
  color: var(--c-text);
}

.source-method-preset-summary::-webkit-details-marker {
  display: none;
}

.source-method-preset-summary::after {
  content: '?';
  font-size: 0.7rem;
  opacity: 0.5;
  flex-shrink: 0;
  margin-left: 0.35rem;
}

details[open].source-method-preset-details > .source-method-preset-summary::after {
  content: '?';
}

.source-method-preset-summary:hover {
  border-color: color-mix(in srgb, var(--c-primary) 60%, transparent);
  color: var(--c-text);
}

.source-method-preset-list {
  display: flex;
  flex-direction: column;
  max-height: 224px;
  overflow-y: auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: 0 4px 10px -3px rgba(0, 0, 0, 0.08);
  padding: 0.2rem 0;
}

button.source-method-preset-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.18rem 0.55rem;
  min-height: 0;
  height: 26px;
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 400;
  text-align: left;
  color: var(--c-text);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  flex-shrink: 0;
  line-height: 1.25;
}

button.source-method-preset-item:last-child {
  border-bottom: none;
}

button.source-method-preset-item:hover {
  background: var(--c-primary-bg);
  color: var(--c-primary);
}

button.source-method-preset-item:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: -2px;
}

/* Compact form-row: label-left + control-right for request config fields */
.source-method-field-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  column-gap: 0.65rem;
  row-gap: 0.25rem;
  min-width: 0;
}

.source-method-field-row > span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--c-text-2);
  white-space: nowrap;
  min-width: 0;
}

.source-method-field-row > input,
.source-method-field-row > select,
.source-method-field-row > .source-method-field-empty {
  justify-self: start;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.source-method-field-ctrl--wide {
  max-width: min(540px, 100%);
}

.source-method-field-ctrl--http {
  width: min(200px, 100%);
  max-width: 200px;
}

.source-method-field-ctrl--medium {
  max-width: min(480px, 100%);
}

/* Read-only profile / execution blocks (Phase 0 Sources boundary) */
.source-method-readonly-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg-subtle, var(--c-bg));
}

.source-method-readonly-block__heading {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.15rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-text-2);
}

.source-method-readonly-block__note,
.source-method-readonly-block__empty {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
}

.source-method-readonly-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.25rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--c-border);
}

.source-method-readonly-group__title {
  margin: 0 0 0.1rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.source-method-readonly-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: baseline;
  column-gap: 0.65rem;
  min-width: 0;
  font-size: 0.775rem;
}

.source-method-readonly-row__label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--c-text-3);
  white-space: nowrap;
  min-width: 0;
}

.source-method-readonly-row__value {
  min-width: 0;
  color: var(--c-text-2);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.72rem;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Field info trigger ? muted help icon, separate from readiness dots */
.field-info-trigger {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-text-3);
  cursor: pointer;
  box-sizing: border-box;
  line-height: 0;
  min-height: 0;
  min-width: 0;
  box-shadow: none;
}

.field-info-trigger:hover {
  color: var(--c-text-2);
  background: var(--c-bg);
}

.field-info-trigger:focus-visible {
  outline: 1px solid var(--c-primary);
  outline-offset: 1px;
}

.source-method-path-params {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}

.source-method-path-params__label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: nowrap;
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--c-text-2);
  line-height: 1.35;
}

.source-method-path-params__label .source-method-path-add {
  margin-left: 0.1rem;
}

.source-method-path-params .constructor-home-source-catalog__qp-editor {
  max-width: min(540px, 100%);
  width: 100%;
}

/* Path params applicability status ? icon trigger, not a readiness dot */
.path-params-status-trigger {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  box-sizing: border-box;
  line-height: 0;
  min-height: 0;
  min-width: 0;
  box-shadow: none;
}

.path-params-status-trigger--not_required,
.path-params-status-trigger--empty_endpoint {
  color: var(--c-text-3);
}

.path-params-status-trigger--detected {
  color: var(--c-text-2);
}

.path-params-status-trigger--warning {
  color: #b45309;
}

.path-params-status-trigger:hover {
  background: var(--c-bg);
}

.path-params-status-trigger--not_required:hover,
.path-params-status-trigger--empty_endpoint:hover {
  color: var(--c-text-2);
}

.path-params-status-trigger--warning:hover {
  color: #92400e;
}

.path-params-status-trigger:focus-visible {
  outline: 1px solid var(--c-primary);
  outline-offset: 1px;
}

/* HoverCard ? floating field help (portal) */
.hovercard {
  z-index: 9500;
  pointer-events: auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 0.65rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--c-text);
}

.hovercard--positioned {
  animation: hovercard-in 0.12s ease;
}

@keyframes hovercard-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.hovercard-text,
.hovercard-body {
  margin: 0;
  color: var(--c-text-2);
}

.hovercard-title {
  margin: 0 0 0.35rem;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--c-text);
}

.hovercard-example {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--c-text-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-word;
}

/* Field-level readiness dot */
.sm-field-dot {
  flex-shrink: 0;
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  vertical-align: middle;
}
.sm-field-dot--empty   { background: #ea580c; } /* orange: required, not filled */
.sm-field-dot--pending { background: #ca8a04; } /* yellow: filled, not tested */
.sm-field-dot--fail    { background: #dc2626; }
.sm-field-dot--ok      { background: #16a34a; }

/* Snapshot mode status note */
.source-method-snapshot-note {
  font-size: 0.775rem;
  color: var(--c-text-2);
  margin: 0;
  padding: 0.25rem 0;
}

.source-method-tabs__content {
  min-width: 0;
  overflow-x: hidden;
  max-width: none;
}


.source-method-work-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 30%);
  gap: 0.85rem 1.1rem;
  align-items: start;
}

.source-method-work-main {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

.source-method-work-main .constructor-home-source-catalog__passport-expandable-body .constructor-home-source-catalog__field {
  max-width: min(480px, 100%);
}

.source-method-work-assistant {
  align-self: start;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--c-bg) 88%, var(--c-surface) 12%);
}

.source-method-work-assistant__hint {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  line-height: 1.35;
}

.source-method-work-assistant .source-method-preset-details {
  margin: 0;
}

.source-method-work-assistant .source-method-preset-list {
  max-height: 200px;
}

.source-method-field-readonly {
  background: var(--c-bg);
  color: var(--c-text-2);
  cursor: default;
}

.source-method-field-empty {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.35;
  padding: 0.32rem 0;
}

.source-method-path-params__note {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.source-method-path-params__note--warn {
  color: #b45309;
}

.source-method-path-add {
  width: 1.75rem;
  min-width: 1.75rem;
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

@media (max-width: 720px) {
  .source-method-work-layout {
    grid-template-columns: 1fr;
  }

  .source-method-work-assistant {
    order: -1;
  }

  .source-method-field-row {
    grid-template-columns: 1fr;
  }

  .source-method-readonly-row {
    grid-template-columns: 1fr;
  }

  .source-method-readonly-row__label {
    white-space: normal;
  }

  .source-method-field-row > span {
    white-space: normal;
  }

  .source-method-field-ctrl--wide,
  .source-method-field-ctrl--http,
  .source-method-field-ctrl--medium {
    max-width: 100%;
    width: 100%;
  }
}

@media (min-width: 721px) {
  .source-method-work-layout {
    grid-template-columns: minmax(0, 70%) minmax(0, 30%);
  }
}

/* Restore section separators: sections are direct children of tab content
   (SourceMethodPassportDrawerSections returns a fragment, so sections land here directly) */
.source-method-tabs__content > section.constructor-home-source-catalog__section {
  border-top: 1px solid var(--c-border);
  padding-top: 0.75rem;
  padding-bottom: 0.5rem;
}

.source-method-tabs__content > section.constructor-home-source-catalog__section:first-of-type {
  border-top: none;
  padding-top: 0;
}

/* Buttons inside tab-content sections should not stretch full-width */
.source-method-tabs__content .constructor-home-source-catalog__section .btn-secondary.btn-sm,
.source-method-tabs__content .constructor-home-source-catalog__section .btn-primary.btn-sm {
  align-self: flex-start;
}

.constructor-home-source-catalog__passport-lede {
  padding: 0.5rem 0 0.25rem;
  font-size: 0.8125rem;
  color: var(--c-text-2);
}

/* Compact config summary strip at top of work tab */
.source-method-tabs__config-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin-bottom: 0.85rem;
  padding: 0.55rem 0.65rem;
  background: var(--c-surface-2, #f8fafc);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 4px);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.source-method-v2-editor .source-method-tabs__config-summary {
  margin-bottom: 0.85rem;
}

.source-method-tabs__config-summary-route {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--c-text);
  min-width: 0;
  flex-wrap: wrap;
}

.source-method-tabs__config-summary-route strong {
  font-weight: 700;
  color: var(--c-primary);
  letter-spacing: 0.03em;
}

.source-method-tabs__config-summary-route code {
  font-family: inherit;
  color: var(--c-text-2);
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-all;
}

.source-method-tabs__config-summary-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  font-size: 0.75rem;
  color: var(--c-text-2);
  font-family: monospace;
  white-space: nowrap;
}

/* ?????? drawer: ?????? flex + gap (?? ?????????? ?? *+* ? ? DOM ????? ?????? ?????? ????????? ???? ?? JSX) */
.constructor-home-source-catalog__drawer-section.constructor-home-source-catalog__section {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin: 0;
  padding-block: 0;
  padding-inline: 0;
  border: none;
  box-shadow: none;
}

.constructor-home-source-catalog__drawer-section > .constructor-home-source-catalog__section-title {
  margin: 0;
  padding: 0 0 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-text-2);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.constructor-home-source-catalog__drawer-section .constructor-home-source-catalog__field {
  gap: 0.3rem;
}

.constructor-home-source-catalog__drawer-section .constructor-home-source-catalog__runtime-grid {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.constructor-home-source-catalog__section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.6rem 0 0.45rem;
  border-top: 1px solid var(--c-border);
}

.constructor-home-source-catalog__section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.constructor-home-source-catalog__section-title {
  margin: 0 0 0.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text);
  letter-spacing: 0.01em;
}

.constructor-home-source-catalog__field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  max-width: min(440px, 100%);
}

.constructor-home-source-catalog__field > span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-text-2);
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.constructor-home-source-catalog__field-input-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  max-width: min(440px, 100%);
}

.constructor-home-source-catalog__field-input-row > input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: none;
}

.constructor-home-source-catalog__docs-open-link {
  flex-shrink: 0;
}

button.constructor-home-source-catalog__docs-open-link:disabled,
button.constructor-home-source-catalog__docs-open-link:disabled:hover {
  opacity: 0.38;
  cursor: not-allowed;
  background: transparent;
  border: none;
  box-shadow: none;
}

.constructor-home-source-catalog__field input,
.constructor-home-source-catalog__field textarea,
.constructor-home-source-catalog__field select {
  width: 100%;
  max-width: min(440px, 100%);
  box-sizing: border-box;
  font: inherit;
  padding: 0.45rem 0.75rem;
  margin: 0;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  /* ?? `background` shorthand ?? select ? ????????? ???? chevron ?? ??????????? `select` */
  background-color: var(--c-surface);
  color: var(--c-text);
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.constructor-home-source-catalog__field select {
  padding-right: 2.25rem;
}

.constructor-home-source-catalog__field input:focus,
.constructor-home-source-catalog__field textarea:focus,
.constructor-home-source-catalog__field select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgb(124 58 237 / 0.12);
}

.constructor-home-source-catalog__field textarea {
  min-height: 4.25rem;
  resize: vertical;
}

.constructor-home-source-catalog__runtime-grid {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: 100%;
  max-width: min(440px, 100%);
}

.constructor-home-source-catalog__runtime-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
  width: 100%;
  max-width: min(440px, 100%);
}

.constructor-home-source-catalog__runtime-grid label > span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-text-2);
  letter-spacing: 0.01em;
}

.constructor-home-source-catalog__runtime-grid label input[type="number"] {
  max-width: 11rem;
}

/* ?????? ???????: ??????? ?????, ???? ????? ????? ??????; ????? ? ???? ? ?? ?????? ???? */
.constructor-home-source-catalog__drawer-section .constructor-home-source-catalog__runtime-grid--compact {
  gap: 0.45rem;
  max-width: 100%;
}

.constructor-home-source-catalog__runtime-grid--compact label {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 0.45rem 0.55rem;
  width: 100%;
  max-width: 100%;
}

.constructor-home-source-catalog__drawer-col--aside .constructor-home-source-catalog__runtime-grid--compact label input[type="number"] {
  width: 5rem;
  min-width: 4.5rem;
  max-width: 5.25rem;
  flex: 0 0 auto;
  box-sizing: border-box;
  padding: 0.35rem 0.4rem;
  text-align: left;
}

.constructor-home-source-catalog__runtime-grid--compact label > span {
  flex: 0 1 auto;
  min-width: 0;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.25;
}

.constructor-home-source-catalog__banner {
  margin: 0;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--c-warning) 12%, transparent);
  font-size: 0.8125rem;
}

.constructor-home-source-catalog__banner--warn {
  background: color-mix(in srgb, var(--c-warning) 8%, transparent);
}

.constructor-home-source-catalog__banner p {
  margin: 0 0 0.25rem;
}

.constructor-home-source-catalog__banner p:last-child {
  margin-bottom: 0;
}

.constructor-home-source-catalog__missing-list {
  margin: 0.2rem 0 0 1rem;
  padding: 0;
  font-size: 0.8125rem;
}

.constructor-home-source-catalog__passport-expandable {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.constructor-home-source-catalog__passport-expandable-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-text-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.constructor-home-source-catalog__passport-expandable-label:hover {
  background-color: var(--c-primary-bg);
}

.constructor-home-source-catalog__passport-expandable-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem 0.6rem;
  border-top: 1px solid var(--c-border);
}

.constructor-home-source-catalog__qp-editor {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.constructor-home-source-catalog__qp-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.constructor-home-source-catalog__qp-row input {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  padding: 0.3rem 0.45rem;
}

.constructor-home-source-catalog__qp-row > .constructor-home__icon-link {
  flex-shrink: 0;
}

.constructor-home-source-catalog__error {
  margin: 0;
  color: var(--c-danger);
  font-size: 0.8125rem;
}

.constructor-home-source-catalog__readiness {
  margin: 0;
  padding-left: 0;
  list-style: none;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.constructor-home-source-catalog__readiness li {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  margin-bottom: 0.35rem;
}

.constructor-home-source-catalog__readiness li:last-child {
  margin-bottom: 0;
}

.constructor-home-source-catalog__readiness .readiness--ok {
  color: var(--c-success);
}

.constructor-home-source-catalog__readiness .readiness--warn {
  color: var(--c-warning-text, #92400e);
}

.constructor-home-source-catalog__readiness .readiness--neutral {
  color: var(--c-text-2);
}

.constructor-home-source-catalog__readiness .readiness--fail {
  color: var(--c-danger);
}

.constructor-home-source-catalog__readiness-text {
  flex: 1;
  min-width: 0;
}

.constructor-home-source-catalog__readiness-mark {
  display: inline-block;
  min-width: 1em;
  flex-shrink: 0;
  margin-top: 0.12em;
}

.constructor-home-source-catalog__edit-open--active {
  background: var(--c-primary-bg);
}

.constructor-home-source-catalog__edit-chevron {
  display: block;
  transition: transform 0.2s ease;
}

.constructor-home-source-catalog__edit-open--active .constructor-home-source-catalog__edit-chevron {
  transform: rotate(-180deg);
}

.constructor-home-source-catalog__drawer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.35rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--c-border);
}

.constructor-home-source-catalog__drawer-actions-spacer {
  flex: 1 1 auto;
  min-width: 0.75rem;
}

.constructor-home-source-catalog__publish-note {
  margin: 0;
  flex: 0 1 auto;
  max-width: 16rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  text-align: right;
}

@media (max-width: 36rem) {
  .constructor-home-source-catalog__drawer-actions-spacer {
    display: none;
  }

  .constructor-home-source-catalog__drawer-header-actions .constructor-home-source-catalog__drawer-header-trail {
    margin-left: auto;
  }
}

/* ??? Constructor home: ???? ?????? ?????? (???????? ? ???????????) ????????? */
.constructor-home__tables-tree {
  margin-top: 0.35rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  padding: 0.15rem 0.45rem 0.45rem;
}

/* ??????????????? ???? (????????? / ????????): ?????? ?????? ?????? ????? border-bottom */
.constructor-home__tables-tree > .constructor-home__tree-node + .constructor-home__tree-node {
  margin-top: 0.45rem;
}

.constructor-home__tree-node--child {
  margin-top: 0.15rem;
}

.constructor-home__tree-node--child + .constructor-home__tree-node--child {
  margin-top: 0.1rem;
}

.constructor-home__tree-node--child .constructor-home__tree-summary {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.2rem 0.12rem;
}

.constructor-home__tree-summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.26rem 0.2rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.875rem;
  line-height: 1.35;
  font-weight: 600;
  color: var(--c-text);
  background: transparent;
  border-radius: var(--radius-sm);
}

.constructor-home__tree-summary::-webkit-details-marker {
  display: none;
}

.constructor-home__tree-summary-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  text-align: left;
}

.constructor-home__tree-summary-label::before {
  content: '?';
  flex-shrink: 0;
  font-size: 0.65rem;
  color: var(--c-text-3);
  font-weight: 400;
  width: 0.75rem;
  text-align: center;
}

.constructor-home__tree-node:not([open]) .constructor-home__tree-summary-label::before {
  content: '?';
}

.constructor-home__tree-summary-meta {
  font-weight: 500;
  font-size: 0.75rem;
  white-space: nowrap;
}

.constructor-home__tree-body {
  padding: 0 0 0.35rem 0.15rem;
}

.constructor-home__tree-body--company {
  padding-left: 0.55rem;
  border-left: 2px solid var(--c-border);
  margin: 0 0 0.15rem 0.35rem;
}

.constructor-home__tree-body--marketplace {
  padding-left: 0.55rem;
  margin: 0.1rem 0 0.15rem 0.35rem;
  border-left: 2px solid color-mix(in srgb, var(--c-primary) 22%, var(--c-border));
}

.constructor-home__table-block {
  margin-top: 0.35rem;
}

.constructor-home__table-block--in-tree {
  margin-top: 0.2rem;
  margin-bottom: 0.1rem;
}

.constructor-home__table-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.constructor-home__table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
}

.constructor-home__table-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.constructor-home__table-row-line1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.constructor-home__table-row-name {
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--c-text);
}

/* ?????? ? ??????: ???? ??????? ???????? .badge (0.7rem), ????? ???????? ????? ? 0.8125rem ?????? */
.constructor-home__table-row .badge {
  font-size: 0.72rem;
  line-height: 1.45;
}

.constructor-home__table-row-status {
  font-weight: 600;
}

.constructor-home__table-row-meta-pill,
.constructor-home__table-row-updated {
  font-weight: 500;
  letter-spacing: 0.02em;
  gap: 0.28rem;
}

.constructor-home__table-row-pill-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.constructor-home__table-row-source {
  font-size: 0.72rem;
  line-height: 1.4;
  word-break: break-word;
}

.constructor-home__table-row-actions {
  flex-shrink: 0;
}

.constructor-home__table-row-confirm {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  max-width: min(100%, 14rem);
}

.constructor-home__row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

a.constructor-home__icon-link,
button.constructor-home__icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border-radius: var(--radius-sm);
  border: none;
  box-shadow: none;
  min-height: 0;
  min-width: 0;
  background: transparent;
  color: var(--c-primary);
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  font: inherit;
}

a.constructor-home__icon-link:hover,
button.constructor-home__icon-link:hover {
  background: var(--c-primary-bg);
  border: none;
  box-shadow: none;
}

a.constructor-home__icon-link:focus-visible,
button.constructor-home__icon-link:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.constructor-home__icon-link--danger {
  color: var(--c-danger);
}

.constructor-home__icon-link--danger:hover {
  background: var(--c-danger-bg);
}

/* ??? Source Config Form Registry (constructor, Stage 3.10b) ????????????????? */
.source-config-form {
  display: grid;
  gap: 0.85rem;
  max-width: 900px;
  padding: 0.85rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface-muted);
}

.source-config-form--disabled {
  border-style: dashed;
}

.source-config-form__header {
  display: grid;
  gap: 0.2rem;
}

.source-config-form__header h4 {
  margin: 0;
  color: var(--c-text);
  font-size: 0.875rem;
}

.source-config-form__header p {
  margin: 0;
  font-size: 0.8125rem;
}

.file-import-panel .file-import-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.file-import-columns {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 14rem;
  overflow: auto;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface-2, var(--c-bg));
}

.file-import-column-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 0.35rem 0.5rem;
  align-items: start;
  font-size: 0.875rem;
}

.file-import-column-row__include {
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0.35rem 0 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--c-primary);
  flex-shrink: 0;
  cursor: pointer;
}

.file-import-column-row__include:focus {
  border-color: transparent;
  box-shadow: none;
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.file-import-column-index {
  min-width: 1.25rem;
  text-align: right;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  padding-top: 0.35rem;
}

.file-import-column-fields {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.file-import-column-title-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.file-import-column-field-label {
  font-size: 0.6875rem;
}

.file-import-column-title-input {
  padding: 0.25rem 0.45rem;
  font-size: 0.8125rem;
}

.file-import-column-meta {
  font-size: 0.75rem;
  line-height: 1.3;
  word-break: break-word;
}

/* /tables ? ???????? ??????? (Stage 3.14 MVP) */
.tables-fs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tables-fs__scope-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tables-fs__scope-tab {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface, var(--c-bg));
  font-size: 0.875rem;
  cursor: pointer;
}

.tables-fs__scope-tab--active {
  border-color: var(--c-accent, #2563eb);
  background: color-mix(in srgb, var(--c-accent, #2563eb) 8%, transparent);
}

.tables-fs__company-select {
  max-width: 22rem;
}

.tables-fs__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tables-fs__toolbar--disk {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.75rem;
}

.tables-fs__toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tables-fs__toolbar-row > .tables-fs__toolbar-actions {
  margin-left: auto;
}

.tables-fs__toolbar-row--tools {
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.tables-fs__toolbar-row--tools .tables-fs__view-toggle {
  flex-shrink: 0;
}

.tables-fs__toolbar-row--tools .tables-fs-filters--plain {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.tables-fs__toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}

.tables-fs-create-menu {
  position: relative;
}

.tables-fs-create-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tables-fs-create-menu__chevron {
  margin-left: 0.1rem;
  opacity: 0.9;
}

.tables-fs-create-menu .tables-fs-row-menu__dropdown {
  right: 0;
  left: auto;
  min-width: 11.5rem;
}

.tables-fs__search {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.tables-fs__view-toggle {
  display: flex;
  gap: 0.25rem;
}

.tables-fs__view-btn--active {
  border-color: var(--c-accent, #2563eb);
}

.tables-fs__scope-hint {
  margin: 0;
  font-size: 0.8125rem;
}

.tables-fs__list-meta {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
}

.tables-fs-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
}

.tables-fs-filters--plain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
}

.tables-fs-filters__menu {
  position: relative;
}

.tables-fs-filters__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.4375rem 0.75rem;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
  color: #3c4043;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.25rem;
  cursor: pointer;
}

.tables-fs-filters__chip:hover,
.tables-fs-filters__chip--open {
  background: #f8f9fa;
}

.tables-fs-filters__chip-chevron {
  flex-shrink: 0;
  color: #5f6368;
}

.tables-fs-filters__dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 50;
  min-width: 12.5rem;
  padding: 0;
  border: 1px solid #e8eaed;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 1px 2px 0 rgb(60 64 67 / 0.3),
    0 2px 6px 2px rgb(60 64 67 / 0.15);
}

.tables-fs-filters__dropdown-item {
  display: block;
  width: 100%;
  padding: 0.8125rem 1.125rem;
  border: none;
  border-bottom: 1px solid #e8eaed;
  border-radius: 0;
  background: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.25rem;
  color: #3c4043;
  text-align: left;
  cursor: pointer;
}

.tables-fs-filters__dropdown-item:last-child {
  border-bottom: none;
}

.tables-fs-filters__dropdown-item:hover {
  background: #f8f9fa;
}

.tables-fs-filters__dropdown-item--active {
  font-weight: 500;
}

.tables-fs-filters--plain .tables-fs-filters__reset {
  margin-left: 0.25rem;
}

.tables-fs-filters__field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 8.5rem;
}

.tables-fs-filters__label {
  font-size: 0.75rem;
  color: var(--c-text-2);
}

.tables-fs-filters__select {
  font-size: 0.8125rem;
}

.tables-fs-filters__reset {
  margin-left: auto;
}

.tables-fs-filters__reset--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  min-width: 2rem;
  min-height: 2rem;
  color: var(--c-text-2);
}

.tables-fs-filters__reset--icon:hover:not(:disabled) {
  color: var(--c-text);
}

.tables-fs-list__empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 1rem 0.25rem;
}

.tables-fs-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  margin-bottom: 0.65rem;
  font-size: 0.8125rem;
}

.tables-fs-breadcrumb--search {
  margin: 0 0 0.65rem;
}

.tables-fs-breadcrumb__segment {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.tables-fs-breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  outline: none;
  padding: 0.15rem 0.25rem;
  min-height: 0;
  border-radius: 0;
  cursor: pointer;
  color: var(--c-accent, #2563eb);
  font: inherit;
  font-weight: 500;
  letter-spacing: normal;
  white-space: nowrap;
  transition: none;
}

.tables-fs-breadcrumb__item:hover:not(:disabled),
.tables-fs-breadcrumb__item:focus,
.tables-fs-breadcrumb__item:focus-visible,
.tables-fs-breadcrumb__item:active {
  outline: none;
  box-shadow: none;
  border: none;
  background: transparent;
  color: var(--c-accent, #2563eb);
}

.tables-fs-breadcrumb__item--current {
  color: var(--c-text);
  font-weight: 600;
  cursor: default;
  pointer-events: none;
}

.tables-fs-breadcrumb__item--current:hover,
.tables-fs-breadcrumb__item--current:focus,
.tables-fs-breadcrumb__item--current:focus-visible,
.tables-fs-breadcrumb__item--current:active {
  color: var(--c-text);
  background: transparent;
}

.tables-fs-folder-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  text-align: center;
}

.tables-fs-folder-empty__text {
  margin: 0;
  font-size: 0.9375rem;
}

.tables-fs--disk .tables-fs-tree--flat .tables-fs-tree__folder-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tables-fs--disk .tables-fs-tree--flat .tables-fs-tree__folder-open--flat {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.4rem;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  outline: none;
  min-height: 0;
}

.tables-fs--disk .tables-fs-tree--flat .tables-fs-tree__folder-open--flat:hover,
.tables-fs--disk .tables-fs-tree--flat .tables-fs-tree__folder-open--flat:focus,
.tables-fs--disk .tables-fs-tree--flat .tables-fs-tree__folder-open--flat:focus-visible,
.tables-fs--disk .tables-fs-tree--flat .tables-fs-tree__folder-open--flat:active {
  outline: none;
  box-shadow: none;
  border: none;
  background: transparent;
}

.tables-fs-list {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  /* visible: иначе меню «⋯» у последней/единственной строки обрезается */
  overflow: visible;
}

.tables-fs-list__row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface, #fff);
}

.tables-fs-list__row:has(.tables-fs-row-menu--open),
.tables-fs-grid-folder:has(.tables-fs-row-menu--open),
.tables-fs-grid-file:has(.tables-fs-row-menu--open),
.tables-fs-tree__summary:has(.tables-fs-row-menu--open),
.tables-fs-tree__table-row:has(.tables-fs-row-menu--open) {
  z-index: 60;
}

.tables-fs-list__row:first-child {
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.tables-fs-list__row:last-child {
  border-bottom: none;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.tables-fs-list__open {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.tables-fs-list__title {
  font-weight: 500;
}

.tables-fs-list__meta {
  font-size: 0.75rem;
  margin-left: auto;
  white-space: nowrap;
}

.tables-fs-list__actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.tables-fs-list__empty {
  padding: 1rem;
  margin: 0;
  text-align: center;
}

.tables-fs-browser {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Сетка в духе Google Drive: папки — полоски, файлы — карточки с превью */
.tables-fs-grid-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.15rem 0;
}

.tables-fs-grid-view__section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tables-fs-grid-view__section-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--c-text-2);
}

.tables-fs-grid-view__empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
}

.tables-fs-grid-folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
  overflow: visible;
}

.tables-fs-grid-folder {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 3rem;
  padding: 0.35rem 0.35rem 0.35rem 0.65rem;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--c-border) 28%, var(--c-surface, #fff));
  overflow: visible;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.tables-fs-grid-folder:hover {
  background: color-mix(in srgb, var(--c-accent, #2563eb) 8%, var(--c-surface, #fff));
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Диск: без hover-анимации папок и без контура на названии файла */
.tables-fs--disk .tables-fs-grid-folder {
  transition: none;
}

.tables-fs--disk .tables-fs-grid-folder:hover {
  background: color-mix(in srgb, var(--c-border) 28%, var(--c-surface, #fff));
  box-shadow: none;
}

.tables-fs--disk .tables-fs-grid-file__title,
.tables-fs--disk .tables-fs-grid-file__title:hover,
.tables-fs--disk .tables-fs-grid-file__title:focus,
.tables-fs--disk .tables-fs-grid-file__title:focus-visible,
.tables-fs--disk .tables-fs-grid-file__name,
.tables-fs--disk .tables-fs-grid-folder__open:focus,
.tables-fs--disk .tables-fs-grid-folder__open:focus-visible {
  outline: none;
  box-shadow: none;
}

.tables-fs--disk .tables-fs-grid-file__title:hover .tables-fs-grid-file__name {
  color: inherit;
  text-decoration: none;
}

.tables-fs--disk .tables-fs-grid-file {
  transition: none;
}

.tables-fs--disk .tables-fs-grid-file:hover {
  background: color-mix(in srgb, var(--c-border) 28%, var(--c-surface, #fff));
  box-shadow: none;
}

button.tables-fs-grid-folder__open {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0.25rem 0;
  border: 0;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  color: inherit;
  text-align: left;
  letter-spacing: normal;
  white-space: nowrap;
  cursor: pointer;
}

button.tables-fs-grid-folder__open:hover:not(:disabled),
button.tables-fs-grid-folder__open:focus,
button.tables-fs-grid-folder__open:focus-visible {
  outline: none;
  box-shadow: none;
  border: 0;
  background: transparent;
}

.tables-fs-grid-folder__icon {
  flex-shrink: 0;
  color: #5f6368;
}

.tables-fs-grid-folder__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
}

.tables-fs-grid-folder__actions {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

a.tables-fs-grid-folder__open--link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0.25rem 0;
  border: 0;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  color: inherit;
  text-decoration: none;
  font: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  text-align: left;
  letter-spacing: normal;
  white-space: nowrap;
  cursor: pointer;
}

a.tables-fs-grid-folder__open--link:hover,
a.tables-fs-grid-folder__open--link:focus,
a.tables-fs-grid-folder__open--link:focus-visible {
  outline: none;
  box-shadow: none;
  background: transparent;
  color: inherit;
  text-decoration: none;
}

.tables-fs-grid-folder__icon--file {
  color: #188038;
}

.tables-fs--disk .tables-fs-grid-folder--file:hover {
  background: color-mix(in srgb, var(--c-border) 28%, var(--c-surface, #fff));
  box-shadow: none;
}

.tables-fs-grid-folder--just-created,
.tables-fs-tree__table-row--just-created {
  animation: tables-fs-just-created 2.2s ease-out;
}

@keyframes tables-fs-just-created {
  0% {
    background: color-mix(in srgb, #188038 18%, var(--c-surface, #fff));
  }
  100% {
    background: color-mix(in srgb, var(--c-border) 28%, var(--c-surface, #fff));
  }
}

.tables-fs--disk .tables-fs-tree__table-row--just-created {
  animation: tables-fs-just-created-row 2.2s ease-out;
}

@keyframes tables-fs-just-created-row {
  0% {
    background: color-mix(in srgb, #188038 14%, #fff);
  }
  100% {
    background: transparent;
  }
}

.tables-fs-grid-files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
  overflow: visible;
}

.tables-fs-grid-file {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 13.5rem;
  padding: 0.65rem;
  border-radius: 0.85rem;
  background: color-mix(in srgb, var(--c-border) 28%, var(--c-surface, #fff));
  overflow: visible;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.tables-fs-grid-file:hover {
  background: color-mix(in srgb, var(--c-accent, #2563eb) 6%, var(--c-surface, #fff));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.tables-fs-grid-file__head {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  min-height: 2rem;
}

.tables-fs-grid-file__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.tables-fs-grid-file__title:hover .tables-fs-grid-file__name {
  color: var(--c-accent, #2563eb);
}

.tables-fs-grid-file__icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  flex-shrink: 0;
  border-radius: 0.35rem;
  background: #188038;
  color: #fff;
}

.tables-fs-grid-file__name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  word-break: break-word;
}

.tables-fs-grid-file__actions {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.tables-fs-grid-file__preview {
  display: block;
  flex: 1;
  min-height: 0;
  text-decoration: none;
}

.tables-fs-grid-file__preview-sheet {
  width: 100%;
  height: 100%;
  min-height: 9.5rem;
  border-radius: 0.65rem;
  background-color: #fff;
  border: 1px solid color-mix(in srgb, var(--c-border) 70%, transparent);
  background-image:
    linear-gradient(#eceff1 1px, transparent 1px),
    linear-gradient(90deg, #eceff1 1px, transparent 1px);
  background-size: 1.35rem 1.1rem;
  background-position: -1px -1px;
}

.tables-fs-row-menu {
  position: relative;
  z-index: 2;
}

.tables-fs-row-menu--open {
  z-index: 70;
}

.tables-fs-row-menu__dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 80;
  min-width: 10rem;
  padding: 0.35rem 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface, #fff);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Google Drive–style context menu («Мой диск» и «Таблицы») */
.tables-fs-row-menu--drive .tables-fs-row-menu__dropdown {
  min-width: 12.5rem;
  padding: 0.5rem 0;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 1px 2px 0 rgb(60 64 67 / 0.3),
    0 2px 6px 2px rgb(60 64 67 / 0.15);
}

.tables-fs-row-menu--drive .tables-fs-row-menu__dropdown button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 0;
  padding: 0.8125rem 1.125rem;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.25rem;
  letter-spacing: normal;
  color: #3c4043;
  text-align: left;
  cursor: pointer;
}

.tables-fs-row-menu--drive .tables-fs-row-menu__dropdown button + button {
  border-top: none;
}

.tables-fs-row-menu--drive .tables-fs-row-menu__dropdown button:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: transparent;
  box-shadow: none;
}

.tables-fs-row-menu--drive .tables-fs-row-menu__item-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  color: #5f6368;
}

.tables-fs-row-menu--drive .tables-fs-row-menu__danger {
  color: #3c4043;
}

/* Окно «Переместить» — тот же drive-стиль, что меню «⋯» */
.drive-move-popover {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.drive-move-popover__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: rgb(32 33 36 / 0.32);
  box-shadow: none;
  cursor: default;
}

.drive-move-popover__backdrop:hover:not(:disabled),
.drive-move-popover__backdrop:focus,
.drive-move-popover__backdrop:focus-visible {
  background: rgb(32 33 36 / 0.32);
  border: none;
  box-shadow: none;
  outline: none;
}

.drive-move-popover__card {
  position: relative;
  z-index: 1;
  width: min(100%, 22rem);
  max-height: min(32rem, calc(100vh - 2rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: none;
  border-radius: 12px;
  background: #fff;
  box-shadow:
    0 1px 2px 0 rgb(60 64 67 / 0.3),
    0 2px 6px 2px rgb(60 64 67 / 0.15);
}

.drive-move-popover__head {
  padding: 1rem 1.125rem 0.65rem;
}

.drive-move-popover__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
  color: #202124;
}

.drive-move-popover__lede {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #5f6368;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drive-move-popover__list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.25rem 0;
}

.drive-move-popover__group {
  padding: 0.55rem 1.125rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #80868b;
}

.drive-move-popover__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0.75rem 1.125rem;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.25rem;
  letter-spacing: normal;
  color: #3c4043;
  text-align: left;
  cursor: pointer;
}

.drive-move-popover__item--tree {
  gap: 0.25rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  padding-right: 0.75rem;
}

.drive-move-popover__tree-chevron,
.drive-move-popover__tree-select {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.drive-move-popover__tree-chevron {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  justify-content: center;
  color: #5f6368;
  transition: transform 0.15s ease;
}

.drive-move-popover__tree-chevron--open {
  transform: rotate(90deg);
}

.drive-move-popover__tree-chevron-spacer {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
}

.drive-move-popover__tree-select {
  flex: 1;
  min-width: 0;
  gap: 0.75rem;
  padding: 0.4rem 0.35rem;
  text-align: left;
}

.drive-move-popover__tree-select:hover:not(:disabled) {
  background: #f8f9fa;
}

.drive-move-popover__item--selected .drive-move-popover__tree-select {
  background: transparent;
}

.drive-move-popover__item:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: transparent;
  box-shadow: none;
}

.drive-move-popover__item--selected {
  background: #e8f0fe;
  color: #1967d2;
}

.drive-move-popover__item--selected:hover:not(:disabled) {
  background: #e8f0fe;
}

.drive-move-popover__item--action {
  border-top: 1px solid #f1f3f4;
}

.drive-move-popover__item-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  color: #5f6368;
}

.drive-move-popover__item--selected .drive-move-popover__item-icon,
.drive-move-popover__item--selected .drive-move-popover__item-check {
  color: #1967d2;
}

.drive-move-popover__item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drive-move-popover__item-check {
  display: inline-flex;
  flex-shrink: 0;
  color: #1967d2;
}

.drive-move-popover__empty {
  padding: 0.75rem 1.125rem 1rem;
}

.drive-move-popover__empty-title {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #202124;
}

.drive-move-popover__hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #5f6368;
}

.drive-move-popover__create {
  display: grid;
  gap: 0.65rem;
  padding: 0.35rem 1.125rem 0;
}

.drive-move-popover__field {
  display: grid;
  gap: 0.3rem;
}

.drive-move-popover__field-label {
  font-size: 0.75rem;
  color: #5f6368;
}

.drive-move-popover__input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 0.875rem;
  color: #202124;
}

.drive-move-popover__input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgb(26 115 232 / 0.2);
}

.drive-move-popover__error {
  margin: 0;
  padding: 0 1.125rem;
  font-size: 0.8125rem;
  color: #d93025;
}

.drive-move-popover__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem 0.75rem;
}

.drive-move-popover__btn {
  min-height: 0;
  margin: 0;
  padding: 0.55rem 0.9rem;
  border: none;
  border-radius: 999px;
  background: none;
  box-shadow: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: normal;
  color: #1a73e8;
  cursor: pointer;
}

.drive-move-popover__btn:hover:not(:disabled) {
  background: #f1f3f4;
  border-color: transparent;
  box-shadow: none;
}

.drive-move-popover__btn--primary {
  background: #1a73e8;
  color: #fff;
}

.drive-move-popover__btn--primary:hover:not(:disabled) {
  background: #1765cc;
  border-color: transparent;
  box-shadow: none;
}

.drive-move-popover__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* У последней строки списка открываем меню вверх — не уходит за низ экрана/панели */
.tables-fs-list__row:last-child .tables-fs-row-menu__dropdown {
  top: auto;
  bottom: calc(100% + 2px);
}

.tables-fs-row-menu__dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.75rem;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
}

.tables-fs-row-menu__dropdown button:hover {
  background: var(--c-surface-2, #f4f4f5);
}

.tables-fs-row-menu__danger {
  color: var(--c-danger);
}

.tables-fs-tree {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.65rem;
}

.tables-fs-tree--list {
  padding: 0.35rem 0.5rem;
}

.tables-fs-tree--list .tables-fs-tree__summary {
  padding: 0.35rem 0.4rem;
  border-radius: var(--radius-sm);
}

.tables-fs-tree--list .tables-fs-tree__summary:hover {
  background: var(--c-surface-2, #f4f4f5);
}

.tables-fs-tree--list .tables-fs-tree__table-row {
  padding: 0.3rem 0.4rem 0.3rem 1.65rem;
  border-radius: var(--radius-sm);
}

.tables-fs-tree--list .tables-fs-tree__table-row:hover {
  background: var(--c-surface-2, #f4f4f5);
}

/* Диск — список как Google Drive: без обводки контейнера, только линии между строками */
.tables-fs--disk .tables-fs-tree--list {
  border: none;
  border-radius: 0;
  padding: 0;
  background: #fff;
}

.tables-fs--disk .tables-fs-tree--list .tables-fs-tree__node {
  border: none;
  background: transparent;
  margin: 0;
}

.tables-fs--disk .tables-fs-tree--list .tables-fs-tree__summary,
.tables-fs--disk .tables-fs-tree--list .tables-fs-tree__table-row {
  min-height: 2.75rem;
  margin: 0;
  padding-top: 0.55rem;
  padding-right: 0.35rem;
  padding-bottom: 0.55rem;
  /* Отступ текста по уровню вложенности; серая полоса на всю ширину */
  padding-left: calc(0.35rem + (var(--tree-depth, 0) * 1.15rem));
  border: none;
  border-top: 1px solid #e8eaed;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
  width: 100%;
}

/* Полосы только между строками — под последним файлом линии нет */
.tables-fs--disk .tables-fs-tree--list > .tables-fs-tree__node:first-child > .tables-fs-tree__summary,
.tables-fs--disk .tables-fs-tree--list > .tables-fs-tree__table-row:first-child {
  border-top: none;
}

.tables-fs--disk .tables-fs-tree--list .tables-fs-tree__body .tables-fs-tree__table-row {
  padding-left: calc(0.35rem + ((var(--tree-depth, 0) + 1) * 1.15rem));
}

.tables-fs--disk .tables-fs-tree--list .tables-fs-tree__table-row--root {
  padding-left: 0.35rem;
}

.tables-fs--disk .tables-fs-tree--list .tables-fs-tree__summary:hover,
.tables-fs--disk .tables-fs-tree--list .tables-fs-tree__table-row:hover {
  background: #f8f9fa;
}

.tables-fs--disk .tables-fs-tree--list .tables-fs-tree__table-open:hover {
  background: transparent;
}

.tables-fs--disk .tables-fs-tree__table-open {
  gap: 0.75rem;
  padding: 0;
  border: none;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  min-height: 0;
}

.tables-fs--disk .tables-fs-tree__table-open:hover:not(:disabled),
.tables-fs--disk .tables-fs-tree__table-open:focus,
.tables-fs--disk .tables-fs-tree__table-open:focus-visible,
.tables-fs--disk .tables-fs-tree__summary:focus,
.tables-fs--disk .tables-fs-tree__summary:focus-visible {
  outline: none;
  box-shadow: none;
  border: none;
  background: transparent;
}

.tables-fs--disk .tables-fs-tree__type-icon {
  flex-shrink: 0;
  color: #5f6368;
}

.tables-fs--disk .tables-fs-tree__file-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.25rem;
  background: #188038;
  color: #fff;
  border: none;
  box-shadow: none;
}

.tables-fs--disk .tables-fs-tree__file-name,
.tables-fs--disk .tables-fs-tree__label {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 400;
  color: #202124;
  outline: none;
}

.tables-fs--disk .tables-fs-tree__table-open:hover .tables-fs-tree__file-name,
.tables-fs--disk .tables-fs-tree__table-open:focus-visible .tables-fs-tree__file-name {
  color: #202124;
  text-decoration: none;
}

.tables-fs--disk .tables-fs-tree__file-meta {
  margin-left: auto;
  padding-left: 1rem;
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: #5f6368;
  white-space: nowrap;
}

.tables-fs--disk .tables-fs-tree--list .tables-fs-row-menu .btn-ghost {
  border: none;
  box-shadow: none;
  background: transparent;
  color: #5f6368;
}

.tables-fs--disk .tables-fs-tree--list .tables-fs-row-menu .btn-ghost:hover:not(:disabled) {
  background: transparent;
  border: none;
  box-shadow: none;
  color: #202124;
}

.tables-fs--disk .tables-fs-tree__table-open:focus,
.tables-fs--disk .tables-fs-tree__table-open:focus-visible,
.tables-fs--disk .tables-fs-tree__summary:focus,
.tables-fs--disk .tables-fs-tree__summary:focus-visible {
  outline: none;
  box-shadow: none;
}

.tables-fs-tree__summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  list-style: none;
}

.tables-fs-tree__summary::-webkit-details-marker {
  display: none;
}

button.tables-fs-tree__chevron {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
  letter-spacing: normal;
  color: #5f6368;
  cursor: pointer;
  transition: transform 0.15s ease;
}

button.tables-fs-tree__chevron:hover:not(:disabled),
button.tables-fs-tree__chevron:focus:not(:disabled),
button.tables-fs-tree__chevron:focus-visible:not(:disabled),
button.tables-fs-tree__chevron:active:not(:disabled) {
  background: transparent;
  border: none;
  border-color: transparent;
  box-shadow: none;
  outline: none;
  color: #202124;
}

button.tables-fs-tree__chevron:disabled {
  cursor: default;
  opacity: 1;
}

button.tables-fs-tree__chevron.tables-fs-tree__chevron--open {
  transform: rotate(90deg);
}

button.tables-fs-tree__chevron.tables-fs-tree__chevron--empty {
  visibility: hidden;
  pointer-events: none;
}

.tables-fs-tree__folder-open {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0.15rem 0.25rem;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  box-shadow: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.tables-fs-tree__folder-open:hover:not(:disabled) {
  background: transparent;
  border: none;
  box-shadow: none;
}

.tables-fs--disk .tables-fs-tree__folder-open,
.tables-fs--disk .tables-fs-tree__folder-open:hover:not(:disabled),
.tables-fs--disk .tables-fs-tree__folder-open:focus,
.tables-fs--disk .tables-fs-tree__folder-open:focus-visible,
.tables-fs--disk .tables-fs-tree__folder-open:active,
.tables-fs--disk .tables-fs-tree__chevron:focus,
.tables-fs--disk .tables-fs-tree__chevron:focus-visible {
  outline: none;
  box-shadow: none;
  border: none;
  background: transparent;
}

.tables-fs--disk .tables-fs-grid-folder__open,
.tables-fs--disk .tables-fs-grid-folder__open:hover:not(:disabled),
.tables-fs--disk .tables-fs-grid-folder__open:focus,
.tables-fs--disk .tables-fs-grid-folder__open:focus-visible,
.tables-fs--disk .tables-fs-grid-folder__open:active {
  outline: none;
  box-shadow: none;
  border: 0;
  background: transparent;
}

.tables-fs-tree__summary-actions {
  display: inline-flex;
  flex-shrink: 0;
  margin-left: auto;
}

.tables-fs-tree__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tables-fs-tree__table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.15rem 0.35rem 0.15rem 1.5rem;
  width: 100%;
}

.tables-fs-tree__table-open {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
  padding: 0.15rem 0.25rem;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.tables-fs-tree__table-open:hover .tables-fs-tree__file-name,
.tables-fs-tree__table-open:focus-visible .tables-fs-tree__file-name {
  color: var(--c-primary, #1a73e8);
  text-decoration: underline;
}

.tables-fs-tree__table-open:hover,
.tables-fs-tree__table-row:hover {
  background: var(--c-surface-2, #f4f4f5);
}

.tables-fs-tree__table-row--root {
  padding-left: 0.35rem;
}

.tables-fs-tree__file-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.tables-fs-tree__file-name {
  min-width: 0;
}

.tables-fs-tree__file-meta {
  margin-left: auto;
}

.tables-fs-row-menu__confirm {
  flex-shrink: 0;
}

.tables-fs-settings-stub__notice {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--c-surface-2, #f4f4f5);
  font-size: 0.875rem;
  margin: 0 0 0.75rem;
}

.tables-fs-settings-stub__list {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  font-size: 0.8125rem;
}

.create-table-source-modal {
  width: 100%;
  max-width: min(28rem, calc(100vw - 2rem));
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.create-table-source-modal__hint {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.create-table-source-modal__next-hint {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.create-table-source-modal__footer {
  margin-top: 0.75rem;
}

.create-table-source-modal__cards {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.create-table-source-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  width: 100%;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface, #fff);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  white-space: normal;
}

.create-table-source-card:hover:not(:disabled) {
  border-color: var(--c-primary, #2563eb);
  background: var(--c-surface-2, #f4f4f5);
}

.create-table-source-card--disabled,
.create-table-source-card:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.create-table-source-card__title {
  font-weight: 600;
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.create-table-source-card__text {
  font-size: 0.8125rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.create-table-source-card__badge {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--c-muted);
}

.create-table-source-card__badge--stub {
  color: var(--c-warning, #b45309);
}

/* ????????: ???????? ??????, ????? ????? ? ???? ???????, ??? �???????� ??????????????? */
.constructor-source-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
  max-width: 36rem;
}

.constructor-source-stack .source-info-card {
  max-width: none;
  width: 100%;
}

/* ?????? ? ????? ???????: ???????? ??????? ? ???? ??????, ?????? ?????? */
.info-grid--wizard {
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 1.25rem;
  row-gap: 0.45rem;
  align-items: baseline;
}

.info-grid--wizard .info-label {
  white-space: nowrap;
  padding-top: 0;
}

.info-grid--wizard .info-value {
  min-width: 0;
  line-height: 1.35;
}

/* Read-only auto-selected account row */
.auto-selected-account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--c-text);
}

/* ??? Compact field selector checklist (constructor, Stage 3.5e) ?????????????? */
.source-field-selector {
  align-self: flex-start;
  width: 100%;
  max-width: 820px;
}

.field-selector-toolbar {
  max-width: 820px;
}

.field-selector-actions {
  display: inline-flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  width: auto;
}

/* ??????: ???????????? ??????, ????? ????? ??????????? (????????? ? ??????). */
.field-selector-list {
  max-width: 820px;
}

.field-selector-group {
  margin-bottom: 0.35rem;
}

.field-selector-group:last-child {
  margin-bottom: 0;
}

.field-selector-group-header {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
  margin: 0.75rem 0 0.35rem;
  padding: 0;
  border: none;
  background: none;
}

.field-selector-group:first-child .field-selector-group-header {
  margin-top: 0;
}

.field-row-label {
  display: grid;
  /* Checkbox + ???????? + ???? ???? (??? �????????????� ???????? ?? ??? ????????). */
  grid-template-columns: 20px auto auto;
  column-gap: 0.625rem;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 0.22rem 0.45rem;
  margin: 0 0 0.08rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  /* ??????? browser outline ? label; ????????? ?????? ?? ????? checkbox */
  outline: none;
}

.field-row-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--c-primary);
  justify-self: start;
}

.field-row-label:hover { background: var(--c-primary-bg); }

.field-row-label--disabled {
  opacity: 0.52;
  cursor: default;
}

.field-row-label--disabled:hover { background: none; }

/* Focus ring ?????? ?? checkbox ?????? ?????? */
.field-row-label:focus-within { outline: none; }

.field-row-label input[type="checkbox"]:focus-visible,
.field-row-label input[type="radio"]:focus-visible,
.field-row-checkbox:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 1px;
}

.field-row-name {
  font-weight: 500;
  font-size: 0.8375rem;
  color: var(--c-text);
  min-width: 0;
  max-width: 22rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ??? ???????? ? �??? ? ???????� ? ???? ?????????? ???? ??????, ??? justify-content: space-between. */
.field-row-end {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.field-row-badge {
  font-size: 0.7rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  padding: 0.06rem 0.35rem;
  border-radius: var(--radius-sm);
  color: var(--c-text-2);
  white-space: nowrap;
  flex-shrink: 0;
}

.field-row-already {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--c-text-3);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ??? Column picker (constructor, available fields UX) ??????????????????????? */
.column-picker-panel {
  width: 100%;
}

.column-picker-panel--loading {
  padding: 0.75rem 0;
}

.column-picker-panel__hint {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.column-picker-panel__hint-sub {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  line-height: 1.35;
}

.column-picker-panel__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.column-picker-panel__meta-sep {
  color: var(--c-text-3);
  font-size: 0.75rem;
}

.column-picker-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  font-size: 0.8125rem;
  color: var(--c-text-2);
  cursor: pointer;
  line-height: 1.35;
}

.column-picker-toggle input {
  margin-top: 0.12rem;
  flex-shrink: 0;
  accent-color: var(--c-primary);
}

/* ?????? �????? + ?????? ???????????� ? ?????????? secondary-???????? */
.column-picker-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.55rem;
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
}

.column-picker-toggle--filter-row {
  margin: 0;
  align-items: center;
  font-size: 0.75rem;
  color: var(--c-text-2);
  gap: 0.35rem;
  flex-shrink: 0;
  max-width: 100%;
}

.column-picker-toggle--filter-row input {
  margin-top: 0;
}

.column-picker-toggle--filter-row span {
  white-space: nowrap;
}

.column-picker-search {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
}

.column-picker-search--in-filter-row {
  flex: 1 1 12rem;
  min-width: 0;
  margin-bottom: 0;
  border: none;
  background: transparent;
  padding: 0;
}

@media (max-width: 480px) {
  .column-picker-filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .column-picker-toggle--filter-row {
    justify-content: flex-start;
  }

  .column-picker-toggle--filter-row span {
    white-space: normal;
  }
}

.column-picker-search__icon {
  display: flex;
  color: var(--c-text-3);
  flex-shrink: 0;
}

.column-picker-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 0.8125rem;
  color: var(--c-text);
  outline: none;
}

.column-picker-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.column-picker-scroll {
  max-height: min(52vh, 22rem);
  overflow-y: auto;
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
  background: var(--c-bg);
}

.col-tools-tab-panel .column-picker-scroll {
  max-height: min(52vh, 24rem);
}

.column-picker-group {
  margin-bottom: 0.15rem;
}

.column-picker-group:last-child {
  margin-bottom: 0;
}

.column-picker-group__summary {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  padding: 0.4rem 0.35rem;
  margin: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-text);
  text-align: left;
  cursor: pointer;
}

.column-picker-group__summary:hover {
  background: var(--c-primary-bg);
}

.column-picker-group__chevron {
  flex-shrink: 0;
  color: var(--c-text-3);
  transition: transform 0.15s ease;
}

.column-picker-group__summary--open .column-picker-group__chevron {
  transform: rotate(90deg);
}

.column-picker-group__title {
  flex: 1;
  min-width: 0;
}

.column-picker-group__count {
  font-size: 0.7rem;
  font-weight: 500;
  flex-shrink: 0;
}

.column-picker-group__body {
  padding: 0 0 0.35rem 1.35rem;
}

.column-picker-group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.15rem 0 0.4rem;
}

.column-picker-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.column-picker-row-wrap {
  margin: 0;
  padding: 0;
}

.column-picker-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.28rem 0.3rem;
  margin: 0 0 0.06rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
}

.column-picker-row:hover:not(.column-picker-row--existing) {
  background: var(--c-primary-bg);
}

.column-picker-row--existing {
  opacity: 0.58;
  cursor: default;
}

.column-picker-row--existing:hover {
  background: transparent;
}

.column-picker-row__check {
  width: 16px;
  height: 16px;
  margin: 0.14rem 0 0;
  flex-shrink: 0;
  accent-color: var(--c-primary);
}

.column-picker-row__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.column-picker-row__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--c-text);
  line-height: 1.25;
  word-break: break-word;
}

.column-picker-row__key {
  font-size: 0.65rem;
  color: var(--c-text-3);
  word-break: break-all;
}

.column-picker-row__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.08rem;
}

.column-picker-tag {
  font-size: 0.62rem;
  font-weight: 500;
  padding: 0.04rem 0.32rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
  white-space: nowrap;
}

.column-picker-tag--type {
  color: var(--c-text-2);
  background: var(--c-surface);
}

.column-picker-tag--data {
  color: var(--c-text-2);
  background: var(--c-bg);
  border-color: var(--c-border-strong);
}

.column-picker-tag--verify {
  color: var(--c-warning, #8a5a00);
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.35);
}

.column-picker-tag--in-table {
  color: var(--c-text-3);
  background: transparent;
}

.column-picker-footer {
  margin-top: 0.75rem;
}

.column-picker-empty-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.column-picker-empty-manual {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.column-picker-empty-manual .form-input {
  flex: 1 1 12rem;
  min-width: 0;
}

.manual-table-editor__toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.manual-add-rows {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.manual-add-rows__field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.manual-add-rows__label {
  font-size: 0.8125rem;
  color: var(--c-text-2);
  white-space: nowrap;
}

.manual-add-rows__input {
  width: 4.25rem;
  min-width: 0;
  padding: 0.3rem 0.45rem;
  font-size: 0.8125rem;
}

.manual-add-rows__quick {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.manual-add-rows__quick-btn {
  min-width: 2.25rem;
  font-variant-numeric: tabular-nums;
}

.manual-add-rows--sheet-footer {
  padding: 0.35rem 0;
}

.manual-spreadsheet-sheet__add-rows-foot {
  z-index: 1;
}

.manual-spreadsheet-sheet__add-rows-cell {
  border: 1px solid var(--c-border);
  border-top: 2px solid color-mix(in srgb, var(--c-border) 70%, var(--c-text-2));
  background: #f0eef5;
  padding: 0.35rem 0.65rem;
  vertical-align: middle;
}

.manual-spreadsheet-sheet__add-rows-foot .manual-spreadsheet-sheet__row-label {
  background: #f0eef5;
  border: 1px solid var(--c-border);
  border-top: 2px solid color-mix(in srgb, var(--c-border) 70%, var(--c-text-2));
}

.manual-table-editor__saving {
  font-size: 0.8125rem;
}

.manual-table-editor__table .manual-table-editor__cell-input {
  width: 100%;
  min-width: 6rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
}

.manual-table-editor__readonly-cell {
  color: var(--c-text-2);
}

.manual-table-editor__actions-col {
  width: 2.5rem;
  text-align: center;
  vertical-align: middle;
}

.manual-table-editor__empty-row {
  text-align: center;
  padding: 1rem;
}

.manual-spreadsheet__intro {
  margin: 0 0 0.85rem;
  font-size: 0.875rem;
}

.manual-spreadsheet__bootstrap-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
  max-width: 28rem;
}

.manual-spreadsheet__bootstrap-label {
  flex: 1 1 14rem;
  min-width: 0;
}

.manual-spreadsheet__grid-wrap {
  margin-top: 0.75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: auto;
}

.manual-spreadsheet__table {
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.manual-spreadsheet__header-cell {
  padding: 0;
  vertical-align: bottom;
  background: var(--c-surface-2, #f4f4f5);
  border-bottom: 1px solid var(--c-border);
  min-width: 8rem;
}

.manual-spreadsheet__header-input {
  width: 100%;
  min-width: 7rem;
  border: none;
  border-radius: 0;
  background: transparent;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.45rem 0.55rem;
}

.manual-spreadsheet__header-input:focus {
  outline: 2px solid var(--c-primary, #2563eb);
  outline-offset: -2px;
  background: var(--c-surface, #fff);
}

.manual-spreadsheet__data-cell {
  padding: 0;
  vertical-align: middle;
  border-bottom: 1px solid var(--c-border-subtle, #eee);
}

.manual-spreadsheet__add-col-header,
.manual-spreadsheet__add-col-spacer {
  width: 2.75rem;
  background: var(--c-surface-2, #f4f4f5);
  border-bottom: 1px solid var(--c-border);
  text-align: center;
  vertical-align: middle;
}

.manual-spreadsheet__add-col-btn {
  width: 100%;
  min-height: 2rem;
}

.column-picker-empty-manual--standalone {
  margin-top: 0.5rem;
}

.column-picker-panel--manual .column-picker-panel__hint {
  margin-bottom: 0.35rem;
}

/* ??? Manual spreadsheet workspace (Excel-like, ?????????? ???? ???????????) ? */

.manual-spreadsheet-workspace {
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.manual-spreadsheet-workspace--immersive {
  position: fixed;
  inset: 0;
  z-index: 180;
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
}

.manual-spreadsheet-workspace--embedded {
  flex: 1;
  min-height: 0;
  width: 100%;
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
}

.manual-spreadsheet-workspace__ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.6rem 1rem;
  background: var(--c-nav-bg);
  color: var(--c-nav-text);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.manual-spreadsheet-workspace__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.manual-spreadsheet-workspace__exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
  background: var(--c-nav-hover);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--c-nav-text);
}

.manual-spreadsheet-workspace__exit:hover:not(:disabled) {
  background: var(--c-nav-active);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.manual-spreadsheet-workspace__exit-label {
  font-size: 0.8125rem;
}

@media (max-width: 640px) {
  .manual-spreadsheet-workspace__exit-label {
    display: none;
  }
}

.manual-spreadsheet-workspace__icon {
  flex-shrink: 0;
  opacity: 0.95;
}

.manual-spreadsheet-workspace__name {
  font-weight: 600;
  font-size: 0.9375rem;
  min-width: 0;
  flex: 0 1 auto;
  margin: 0;
  line-height: 1.25;
  color: inherit;
}

.manual-spreadsheet-workspace__name-btn {
  display: inline-block;
  max-width: min(50vw, 28rem);
  border: none;
  background: transparent;
  padding: 0.05rem 0.2rem;
  margin: -0.05rem -0.2rem;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.manual-spreadsheet-workspace__name-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-spreadsheet-workspace__name-input {
  display: inline-block;
  max-width: min(50vw, 28rem);
  min-width: 8rem;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.05rem 0.2rem;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: inherit;
  color: inherit;
  outline: none;
}

.manual-spreadsheet-workspace__name-input:focus {
  background: rgba(255, 255, 255, 0.14);
}

.manual-spreadsheet-workspace__name-btn:hover,
.manual-spreadsheet-workspace__name-btn:focus-visible {
  background: none !important;
  outline: none !important;
  cursor: default;
}

.manual-spreadsheet-workspace__name-btn:hover .manual-spreadsheet-workspace__name-text {
  background: none !important;
}

.manual-spreadsheet-workspace__title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 0 1 auto;
  gap: 0.1rem;
}

.manual-spreadsheet-workspace__save-status {
  position: relative;
  margin: 0;
  font-size: 0.6875rem;
  line-height: 1;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  min-height: 0.75rem;
}

.manual-spreadsheet-workspace__save-status-sizer {
  display: block;
  visibility: hidden;
  white-space: nowrap;
  pointer-events: none;
}

.manual-spreadsheet-workspace__save-status-text {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
}

.manual-spreadsheet-workspace__save-status--saved {
  color: #fff;
}

.manual-spreadsheet-workspace__save-status--error {
  color: #ffb4b4;
}

.manual-spreadsheet-workspace__save-status--idle {
  visibility: hidden;
}

.manual-spreadsheet-workspace__badge {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--c-nav-active);
  color: var(--c-nav-text);
  flex-shrink: 0;
}

.manual-spreadsheet-workspace__ribbon-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: auto;
}

/* Кнопки в фиолетовой ленте — полупрозрачные, как «К диску», без белого контраста */
.manual-spreadsheet-workspace__ribbon-end .btn-secondary {
  background: var(--c-nav-hover);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--c-nav-text);
  box-shadow: none;
}

.manual-spreadsheet-workspace__ribbon-end .btn-secondary:hover:not(:disabled) {
  background: var(--c-nav-active);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.spreadsheet-document-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.spreadsheet-document-actions__status {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  color: var(--c-nav-text);
}

.spreadsheet-document-actions__autosave {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

.spreadsheet-document-actions__autosave--saved {
  color: #b8f0c8;
}

.spreadsheet-document-actions__autosave--error {
  color: #ffb4b4;
}

.spreadsheet-document-actions__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.spreadsheet-export-menu {
  position: relative;
}

.spreadsheet-export-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding-inline: 0.45rem 0.35rem;
}

.spreadsheet-export-menu__chevron {
  opacity: 0.75;
}

.spreadsheet-export-menu__dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 30;
  min-width: 9.5rem;
  padding: 0.3rem 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  background: var(--c-surface, #fff);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.spreadsheet-export-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.75rem;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--c-text);
  cursor: pointer;
}

.spreadsheet-export-menu__item:hover:not(:disabled) {
  background: var(--c-surface-2, #f4f4f5);
}

.spreadsheet-export-menu__item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.manual-spreadsheet-workspace__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.manual-spreadsheet-workspace__actions .btn-secondary {
  background: var(--c-nav-hover);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--c-nav-text);
}

/* В светлой панели файла кнопки actions — обычный secondary, не «ленточные» */
.disk-file-toolbar .manual-spreadsheet-workspace__actions .btn-secondary {
  background: var(--c-surface);
  border-color: var(--c-border-strong);
  color: var(--c-text);
  box-shadow: var(--shadow-sm);
}

.disk-file-toolbar .manual-spreadsheet-workspace__actions .btn-secondary:hover:not(:disabled) {
  background: var(--c-bg);
  border-color: var(--c-text-3);
  color: var(--c-text);
}

.spreadsheet-document-actions .btn-secondary {
  background: var(--c-nav-hover);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--c-nav-text);
}

.spreadsheet-document-actions .btn-secondary:hover:not(:disabled) {
  background: var(--c-nav-active);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.spreadsheet-export-menu .btn-secondary {
  background: var(--c-nav-hover);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--c-nav-text);
}

.spreadsheet-export-menu .btn-secondary:hover:not(:disabled) {
  background: var(--c-nav-active);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.manual-spreadsheet-workspace__actions .btn-secondary:hover:not(:disabled) {
  background: var(--c-nav-active);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.manual-spreadsheet-workspace__actions .btn-primary {
  box-shadow: none;
}

.manual-spreadsheet-workspace__meta {
  flex-shrink: 0;
  padding: 0.45rem 1rem 0.35rem;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}

.manual-spreadsheet-workspace__meta .table-setup-progress {
  margin: 0;
}

.manual-spreadsheet-workspace__view-controls {
  flex-shrink: 0;
  padding: 0.5rem 0.75rem 0;
}

.manual-spreadsheet-workspace__view-controls .table-view-controls {
  margin: 0;
}

.manual-spreadsheet-workspace__error {
  margin: 0.5rem 1rem 0;
  flex-shrink: 0;
}

.manual-spreadsheet-workspace__canvas {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0.65rem 1rem 0.75rem;
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
}

.manual-spreadsheet-workspace--embedded .manual-spreadsheet-workspace__canvas.fortune-sheet-workspace__canvas,
.manual-spreadsheet-workspace--immersive .manual-spreadsheet-workspace__canvas.fortune-sheet-workspace__canvas {
  padding: 0;
}

.manual-spreadsheet-sheet {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}

.excel-quick-toolbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  flex-shrink: 0;
  padding: 0.45rem 1.25rem;
  background: var(--c-surface);
  border: none;
  border-bottom: 1px solid var(--c-border);
  border-radius: 0;
}

.sheet-format-toolbar {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
  min-height: 2.25rem;
  padding: 0.2rem 0.65rem;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
}

.sheet-format-toolbar__group {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
}

.sheet-format-toolbar__sep {
  display: inline-block;
  width: 1px;
  height: 1.25rem;
  margin: 0 0.25rem;
  background: var(--c-border);
  flex-shrink: 0;
}

.sheet-format-toolbar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-text-2);
  cursor: pointer;
}

.sheet-format-toolbar__btn:hover:not(:disabled) {
  background: var(--c-bg);
  border-color: var(--c-border);
  color: var(--c-text);
}

.sheet-format-toolbar__btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.sheet-format-toolbar__btn--active {
  background: var(--c-primary-bg);
  border-color: color-mix(in srgb, var(--c-primary) 35%, var(--c-border));
  color: var(--c-primary);
}

.sheet-format-toolbar__btn--stub:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sheet-format-toolbar__select {
  height: 1.75rem;
  padding: 0 0.35rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 0.75rem;
  max-width: 7.5rem;
}

.sheet-format-toolbar__select--zoom {
  max-width: 4.25rem;
  text-align: center;
}

.sheet-format-toolbar__select--format {
  max-width: 8.5rem;
}

.sheet-format-toolbar__menu {
  position: relative;
}

.sheet-format-toolbar__select-btn {
  min-width: 8.5rem;
  justify-content: flex-start;
  padding: 0 0.45rem;
}

.sheet-format-toolbar__select-btn-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  text-align: left;
}

.sheet-format-toolbar__select--font {
  max-width: 7.5rem;
}

.sheet-format-toolbar__select--size {
  max-width: 3.25rem;
  text-align: center;
}

.sheet-format-toolbar__select--stub:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sheet-format-toolbar__hint {
  margin-left: auto;
  padding-left: 0.5rem;
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.sheet-format-toolbar__select--border {
  max-width: 7.5rem;
}

.sheet-format-toolbar__color {
  position: relative;
}

.sheet-format-toolbar__btn--color {
  position: relative;
  padding-right: 1.35rem;
}

.sheet-format-toolbar__color-swatch {
  position: absolute;
  right: 0.2rem;
  bottom: 0.2rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  border: 1px solid var(--c-border);
  pointer-events: none;
}

.sheet-format-toolbar__color-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  min-width: 10.5rem;
  padding: 0.45rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.sheet-format-toolbar__color-popover--fixed {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10050;
  max-width: calc(100vw - 1rem);
}

.sheet-format-toolbar__menu-popover {
  min-width: 10rem;
  padding: 0.35rem;
}

.sheet-format-toolbar__menu-popover--fixed {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10050;
  max-width: calc(100vw - 1rem);
}

.sheet-format-toolbar__menu-option {
  display: block;
  width: 100%;
  padding: 0.35rem 0.55rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-text);
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.sheet-format-toolbar__menu-option:hover {
  background: var(--c-nav-hover);
}

.sheet-format-toolbar__menu-option--active {
  background: var(--c-primary-bg);
  color: var(--c-primary);
  font-weight: 600;
}

.sheet-format-toolbar__color-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.2rem;
  margin-bottom: 0.35rem;
}

.sheet-format-toolbar__color-chip {
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  border: 1px solid var(--c-border);
  border-radius: 2px;
  cursor: pointer;
}

.sheet-format-toolbar__color-chip:hover {
  transform: scale(1.08);
}

.sheet-format-toolbar__color-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--c-text-muted);
}

.sheet-format-toolbar__color-custom input[type='color'] {
  width: 2rem;
  height: 1.35rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.sheet-format-toolbar__color-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.68rem;
}

.sheet-format-toolbar__border-popover {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 9rem;
}

.sheet-format-toolbar__border-option {
  display: block;
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-text);
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.sheet-format-toolbar__border-option:hover {
  background: var(--c-nav-hover);
}

.table-view--zoom-50 {
  font-size: 50%;
}

.excel-formula-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--c-surface);
  border: none;
  border-bottom: 1px solid var(--c-border);
  border-radius: 0;
  overflow: hidden;
  flex-shrink: 0;
}

.excel-name-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 3.25rem;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-primary);
  background: var(--c-primary-bg);
  border-right: 1px solid var(--c-border);
}

.excel-fx {
  display: flex;
  align-items: center;
  padding: 0 0.55rem;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--c-text-3);
  border-right: 1px solid var(--c-border);
  background: var(--c-surface);
  user-select: none;
}

.excel-formula-input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 0.4rem 0.65rem;
  font: inherit;
  font-size: 0.8125rem;
  background: var(--c-surface);
  color: var(--c-text);
}

.excel-formula-input:focus {
  outline: none;
}

.manual-table-editor__cell-input--formula {
  color: var(--c-text);
}

.manual-table-editor__cell-input--error {
  color: var(--c-danger);
  font-weight: 600;
}

.manual-spreadsheet-sheet__table-wrap {
  position: relative;
  display: inline-block;
  min-width: 100%;
}

.manual-spreadsheet-sheet__selection-layers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.manual-spreadsheet-sheet__selection-layer {
  position: absolute;
  display: none;
  pointer-events: none;
  box-sizing: border-box;
}

.manual-spreadsheet-sheet__selection-layer--range {
  background: color-mix(in srgb, var(--c-primary) 14%, var(--c-surface));
}

.manual-spreadsheet-sheet__selection-layer--active {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--c-primary);
  z-index: 1;
}

.manual-spreadsheet-sheet__selection-layer--copy {
  outline: 2px dashed var(--c-primary);
  outline-offset: -2px;
  z-index: 2;
}

.manual-spreadsheet-sheet__fill-handle--overlay {
  position: absolute;
  pointer-events: auto;
  z-index: 3;
}

.manual-spreadsheet-sheet__viewport {
  flex: 1;
  min-height: 12rem;
  overflow: auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-top: none;
  box-shadow: var(--shadow-sm);
}

.data-table-scroll-shell > .manual-spreadsheet-sheet__viewport {
  flex: 1;
  min-height: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.manual-spreadsheet-sheet__scroll-shell {
  flex: 1;
  min-height: 12rem;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.manual-spreadsheet-sheet__scroll-shell.data-table-scroll-shell {
  border: none;
  border-radius: 0;
  box-shadow: none;
  max-height: none;
  flex: 1;
  min-height: 0;
}

.manual-spreadsheet-sheet__scroll-shell.data-table-scroll-shell .data-table-scroll-main {
  flex: 1;
  min-height: 0;
}

.manual-spreadsheet-sheet__scroll-shell.data-table-scroll-shell .data-table-scroll-body-col {
  flex: 1;
  min-height: 0;
}

.manual-spreadsheet-sheet__viewport--formula-pick {
  cursor: crosshair;
}

.manual-spreadsheet-sheet__viewport--formula-pick .manual-table-editor__cell-input[readonly] {
  cursor: crosshair;
}

.manual-spreadsheet-sheet__viewport--filter-pick {
  cursor: crosshair;
}

.manual-spreadsheet-sheet__viewport--filter-pick .manual-table-editor__cell-input[readonly],
.manual-spreadsheet-sheet__viewport--filter-pick .manual-spreadsheet-sheet__data-cell {
  cursor: crosshair;
}

.manual-spreadsheet-sheet__selection-hint {
  font-size: 0.8125rem;
  align-self: center;
}

.manual-spreadsheet-sheet__table {
  border-collapse: collapse;
  width: max-content;
  min-width: 0;
  background: var(--c-surface);
  --sheet-letters-row-height: 28px;
}

.manual-spreadsheet-sheet__table--resizable {
  table-layout: fixed;
}

.manual-spreadsheet-sheet__table--resizable .manual-spreadsheet-sheet__data-row > .manual-spreadsheet-sheet__data-cell {
  position: relative;
  height: var(--sheet-row-height, 1.75rem);
  min-height: var(--sheet-row-height, 1.75rem);
  padding: 0;
  vertical-align: top;
  overflow: hidden;
}

.manual-spreadsheet-sheet__table--resizable .manual-spreadsheet-sheet__data-cell {
  min-width: 0;
  max-width: none;
  width: auto;
  max-height: none;
  background: var(--sheet-cell-fill, var(--c-surface));
}

.manual-spreadsheet-sheet__table--resizable .manual-spreadsheet-sheet__cell-surface {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--sheet-cell-fill, inherit);
}

.manual-spreadsheet-sheet__table--resizable
  .manual-spreadsheet-sheet__data-row--enlarged
  .manual-spreadsheet-sheet__cell-surface {
  justify-content: flex-end;
}

.manual-spreadsheet-sheet__table--resizable
  .manual-spreadsheet-sheet__data-row--enlarged
  .manual-table-editor__cell-input[readonly] {
  flex: 0 0 auto;
  min-height: 0;
  height: auto;
  max-height: 100%;
}

.manual-spreadsheet-sheet__table--wrap-text
  .manual-spreadsheet-sheet__data-row--enlarged
  .manual-table-editor__cell-input--wrap[readonly] {
  flex: 0 0 auto;
}

.manual-spreadsheet-sheet__table--resizable .manual-spreadsheet-sheet__data-cell--selected {
  background: var(--sheet-cell-fill, var(--c-surface));
}

.manual-spreadsheet-sheet__table--resizable .manual-spreadsheet-sheet__data-cell--selected .manual-spreadsheet-sheet__cell-surface {
  background: var(--sheet-cell-fill, color-mix(in srgb, var(--c-primary) 14%, var(--c-surface)));
}

.manual-spreadsheet-sheet__table--resizable
  .manual-spreadsheet-sheet__data-cell--selected.manual-spreadsheet-sheet__data-cell--active
  .manual-spreadsheet-sheet__cell-surface {
  background: var(--sheet-cell-fill, #fff);
  box-shadow: inset 0 0 0 2px var(--c-primary);
}

.manual-spreadsheet-sheet__table--resizable
  .manual-spreadsheet-sheet__data-cell--selected.manual-spreadsheet-sheet__data-cell--active
  .manual-table-editor__cell-input:not([readonly]) {
  color: var(--sheet-cell-text, var(--c-text));
  background: var(--sheet-cell-fill, #fff);
}

.manual-spreadsheet-sheet__data-cell--copy-source .manual-spreadsheet-sheet__cell-surface {
  outline: 2px dashed var(--c-primary);
  outline-offset: -2px;
}

.manual-spreadsheet-sheet__table--resizable .manual-spreadsheet-sheet__data-cell--copy-source .manual-spreadsheet-sheet__cell-surface {
  outline: 2px dashed var(--c-primary);
  outline-offset: -2px;
}

.manual-spreadsheet-sheet__table--resizable .table-col-header--sheet {
  width: 100%;
  min-height: 0;
  height: auto;
  flex: 0 0 auto;
  align-items: flex-start;
  align-self: stretch;
}

.manual-spreadsheet-sheet__table--resizable .manual-spreadsheet-sheet__header-row .manual-table-editor__cell-input--header {
  min-height: 0;
  max-height: none;
  height: auto;
  line-height: 1.25rem;
  background: transparent;
}

.manual-spreadsheet-sheet__table--resizable .manual-spreadsheet-sheet__data-cell .manual-table-editor__cell-input {
  min-width: 0;
  max-width: none;
  min-height: 0;
  max-height: none;
  width: 100%;
  height: auto;
  line-height: 1.25rem;
  vertical-align: top;
  color: var(--sheet-cell-text, inherit);
  background: transparent;
  flex: 0 0 auto;
}

.manual-spreadsheet-sheet__table--resizable .manual-spreadsheet-sheet__data-cell .manual-table-editor__cell-input:not([readonly]) {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  align-self: stretch;
  min-height: 100%;
  color: var(--sheet-cell-text, inherit);
  background: var(--sheet-cell-fill, #fff);
}

.manual-spreadsheet-sheet__table--resizable .manual-spreadsheet-sheet__data-cell .manual-table-editor__cell-input:focus {
  outline: none;
  background: #fff;
  box-shadow: none;
}

.manual-spreadsheet-sheet__wrap-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--c-text-2);
  cursor: pointer;
  user-select: none;
  margin-left: 0.35rem;
}

.manual-spreadsheet-sheet__wrap-toggle input {
  margin: 0;
}

.manual-spreadsheet-sheet__table--wrap-text .manual-spreadsheet-sheet__cell-surface {
  overflow: hidden;
}

.manual-spreadsheet-sheet__table--wrap-text .manual-table-editor__cell-input--wrap {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  resize: none;
  overflow: hidden;
  overflow-y: hidden;
  scrollbar-width: none;
  width: 100%;
  flex: 1 1 auto;
  align-self: stretch;
  min-height: 1.25rem;
  height: auto;
  max-height: none;
  field-sizing: content;
}

.manual-spreadsheet-sheet__table--wrap-text .manual-table-editor__cell-input--wrap::-webkit-scrollbar {
  display: none;
}

.manual-spreadsheet-sheet__table--resizable:not(.manual-spreadsheet-sheet__table--wrap-text)
  .manual-table-editor__cell-input[readonly] {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.manual-spreadsheet-sheet__table--wrap-text .manual-spreadsheet-sheet__data-cell .manual-table-editor__cell-input[readonly],
.manual-spreadsheet-sheet__table--wrap-text .manual-spreadsheet-sheet__data-cell .manual-table-editor__cell-input--wrap[readonly] {
  pointer-events: none;
  cursor: cell;
}


.sheet-grid-resize-handle {
  position: absolute;
  z-index: 4;
  touch-action: none;
}

.sheet-grid-resize-handle--column {
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
}

.sheet-grid-resize-handle--row {
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 6px;
  cursor: row-resize;
}

.sheet-grid-resize-handle--column:hover,
.sheet-grid-resize-handle--row:hover,
body.sheet-grid-resizing-col .sheet-grid-resize-handle--column,
body.sheet-grid-resizing-row .sheet-grid-resize-handle--row {
  background: color-mix(in srgb, var(--c-primary) 35%, transparent);
}

body.sheet-grid-resizing-col,
body.sheet-grid-resizing-col * {
  cursor: col-resize !important;
  user-select: none !important;
}

body.sheet-grid-resizing-row * {
  cursor: row-resize !important;
  user-select: none !important;
}

.manual-spreadsheet-sheet__fill-handle {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  background: var(--c-primary);
  border: 1px solid #fff;
  cursor: crosshair;
  z-index: 6;
  box-sizing: border-box;
}

.manual-spreadsheet-sheet__viewport--fill-dragging {
  user-select: none;
  cursor: crosshair;
}

.manual-spreadsheet-sheet__corner,
.manual-spreadsheet-sheet__actions-corner {
  width: 2.25rem;
  min-width: 2.25rem;
  padding: 0;
  background: #f0eef5;
  border: 1px solid var(--c-border);
  position: sticky;
  left: 0;
  z-index: 3;
}

.manual-spreadsheet-sheet__col-label,
.manual-spreadsheet-sheet__row-label {
  background: #f0eef5;
  color: var(--c-text-2);
  font-size: 0.6875rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--c-border);
  padding: 0.2rem 0.35rem;
  user-select: none;
}

.manual-spreadsheet-sheet__title-row th,
.manual-spreadsheet-sheet__title-row td {
  position: sticky;
  top: var(--sheet-letters-row-height, 28px);
  z-index: 4;
  background: #f7f6fa;
  border: 1px solid var(--c-border);
  font-weight: 600;
  color: var(--c-text);
}

.manual-spreadsheet-sheet__row-label--title {
  z-index: 5;
  left: 0;
}

.manual-spreadsheet-sheet__title-cell {
  padding: 0;
  vertical-align: middle;
}

.manual-spreadsheet-sheet__title-cell-inner {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
  height: 100%;
  padding: 0.2rem 0.35rem;
  box-sizing: border-box;
}

.manual-spreadsheet-sheet__title-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: left;
}

.manual-spreadsheet-sheet__letters-row th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f0eef5;
}

.manual-spreadsheet-sheet__corner {
  z-index: 6;
}

.manual-spreadsheet-sheet__row-label {
  width: 2.25rem;
  min-width: 2.25rem;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f0eef5;
  vertical-align: middle;
}

.manual-spreadsheet-sheet__row-label-num {
  display: block;
  text-align: center;
}

.sheet-context-menu {
  position: fixed;
  z-index: 1200;
  min-width: 11.5rem;
  padding: 0.3rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  box-shadow: var(--shadow-md);
}

.sheet-context-menu__item {
  display: block;
  width: 100%;
  padding: 0.4rem 0.55rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-text);
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.sheet-context-menu__item:hover:not(:disabled) {
  background: var(--c-primary-bg);
}

.sheet-context-menu__item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sheet-context-menu__item--danger {
  color: var(--c-danger);
}

.sheet-context-menu__item--danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--c-danger) 12%, var(--c-surface));
}

.sheet-context-menu__sep {
  height: 1px;
  margin: 0.25rem 0.2rem;
  background: var(--c-border);
}

.manual-spreadsheet-sheet__header-row .manual-table-editor__cell-input--header {
  font-weight: 600;
  background: var(--c-primary-bg);
}

.manual-spreadsheet-sheet__data-cell {
  border: 1px solid var(--c-border);
  padding: 0;
  vertical-align: middle;
  min-width: 6.5rem;
  height: 1.75rem;
  background: var(--c-surface);
}

.manual-spreadsheet-sheet__data-cell--inactive {
  background: color-mix(in srgb, var(--c-surface) 92%, var(--c-border));
}

.manual-spreadsheet-sheet__data-cell--selected {
  background: color-mix(in srgb, var(--c-primary) 14%, var(--c-surface));
}

.manual-spreadsheet-sheet__data-cell--selected.manual-spreadsheet-sheet__data-cell--active {
  background: color-mix(in srgb, var(--c-primary) 22%, var(--c-surface));
  box-shadow: inset 0 0 0 2px var(--c-primary);
}

.manual-spreadsheet-sheet__table--resizable .manual-spreadsheet-sheet__data-cell--selected,
.manual-spreadsheet-sheet__table--resizable .manual-spreadsheet-sheet__data-cell--selected.manual-spreadsheet-sheet__data-cell--active {
  background: var(--c-surface);
  box-shadow: none;
}

.manual-spreadsheet-sheet__viewport--selecting {
  user-select: none;
  cursor: cell;
}

.manual-spreadsheet-sheet__data-cell--drag-preview {
  background: color-mix(in srgb, var(--c-primary) 14%, var(--c-surface));
}

.manual-spreadsheet-sheet__table--resizable .manual-spreadsheet-sheet__data-cell--drag-preview {
  background: var(--c-surface);
}

.manual-spreadsheet-sheet__table--resizable .manual-spreadsheet-sheet__data-cell--drag-preview .manual-spreadsheet-sheet__cell-surface {
  background: color-mix(in srgb, var(--c-primary) 14%, var(--c-surface));
}

.manual-spreadsheet-sheet__data-cell--drag-active,
.manual-spreadsheet-sheet__table--resizable .manual-spreadsheet-sheet__data-cell--drag-active .manual-spreadsheet-sheet__cell-surface {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--c-primary);
}

.manual-spreadsheet-sheet__data-cell .manual-table-editor__cell-input[readonly] {
  pointer-events: none;
  cursor: cell;
}

.manual-spreadsheet-sheet__data-cell span.manual-table-editor__cell-input {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  cursor: cell;
  user-select: none;
}

.manual-spreadsheet-sheet__table--wrap-text .manual-spreadsheet-sheet__data-cell span.manual-table-editor__cell-input {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

.manual-spreadsheet-sheet__data-cell .manual-table-editor__cell-input {
  border: none;
  border-radius: 0;
  width: 100%;
  min-width: 6.5rem;
  height: 100%;
  min-height: 1.75rem;
  padding: 0 0.45rem;
  font-size: 0.8125rem;
  color: var(--sheet-cell-text, inherit);
  background: transparent;
  box-shadow: none;
}

.manual-spreadsheet-sheet__data-cell .manual-table-editor__cell-input:focus {
  outline: 2px solid var(--c-primary);
  outline-offset: -2px;
  color: var(--sheet-cell-text, inherit);
  background: var(--sheet-cell-fill, #fff);
  z-index: 1;
  position: relative;
}

.manual-spreadsheet-sheet__add-col-header,
.manual-spreadsheet-sheet__add-col-spacer {
  width: 2.25rem;
  min-width: 2.25rem;
  background: #f0eef5;
  border: 1px solid var(--c-border);
  text-align: center;
  vertical-align: middle;
  padding: 0;
}

.excel-add-col-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 1.5rem;
  border: none;
  background: transparent;
  color: var(--c-primary);
  cursor: pointer;
  border-radius: 0;
}

.excel-add-col-btn:hover:not(:disabled) {
  background: var(--c-primary-bg);
}

.manual-spreadsheet-sheet__row-actions {
  width: 2rem;
  min-width: 2rem;
  text-align: center;
  vertical-align: middle;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  padding: 0;
}

.manual-spreadsheet-sheet__inline-error {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
}

.manual-spreadsheet-sheet__placeholder-row td {
  background: var(--c-primary-bg);
}

.excel-sheet-tabs {
  display: flex;
  align-items: flex-end;
  gap: 0.15rem;
  padding: 0.35rem 0.65rem 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  flex-shrink: 0;
}

.excel-sheet-tab {
  border: 1px solid var(--c-border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--c-bg);
  color: var(--c-text-2);
  font: inherit;
  font-size: 0.75rem;
  padding: 0.3rem 0.85rem;
  cursor: default;
}

.excel-sheet-tab--active {
  background: var(--c-surface);
  color: var(--c-primary);
  font-weight: 600;
  border-color: var(--c-primary-border);
  box-shadow: inset 0 2px 0 var(--c-primary);
}

.manual-spreadsheet-sheet--bootstrap .manual-spreadsheet-sheet__viewport {
  min-width: 16rem;
}

.manual-spreadsheet-sheet--bootstrap .data-table-scroll-shell {
  flex: 1;
  min-height: 12rem;
  min-width: 16rem;
  border-top: none;
  box-shadow: var(--shadow-sm);
}

.manual-spreadsheet-sheet--bootstrap .excel-formula-bar {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.column-picker-row:focus-within {
  outline: none;
}

.column-picker-row__check:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 1px;
}

/* ??? Column settings list (constructor, Stage 3.5g) ????????????????????????? */
.column-settings-row-wrap {
  margin-bottom: 0.35rem;
}

.column-settings-row-wrap--dragging {
  z-index: 1;
}

.column-settings-editor {
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem 0.65rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg);
}

.column-settings-editor-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 22rem;
}

.column-settings-editor-field label {
  display: block;
  font-size: 0.75rem;
  color: var(--c-text-2);
  margin-bottom: 0.2rem;
}

.column-settings-editor-field input,
.column-settings-editor-field select {
  width: 100%;
  max-width: 20rem;
  box-sizing: border-box;
}

.column-settings-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.column-settings-editor-error {
  margin: 0;
  font-size: 0.8125rem;
}

.column-settings-list {
  max-width: 52rem;
  position: relative;
}

.constructor-column-panel .column-settings-list {
  max-width: none;
}

.column-settings-list.column-settings-list--searching .column-settings-row-wrap.column-settings-row-wrap--search-hide {
  display: none;
}

.column-settings-panel-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.column-settings-search {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
}

.column-settings-search__icon {
  display: flex;
  color: var(--c-text-3);
  flex-shrink: 0;
}

.column-settings-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 0.8125rem;
  color: var(--c-text);
  outline: none;
}

.column-settings-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.column-settings-row {
  display: grid;
  grid-template-columns: 2rem 1.25rem minmax(0, 1fr) auto auto;
  gap: 0.35rem 0.5rem;
  align-items: center;
  padding: 0.35rem 0.45rem;
  margin-bottom: 0.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--c-surface);
}

.column-settings-row-wrap .column-settings-row {
  margin-bottom: 0;
}

.column-settings-row:hover:not(.column-settings-row--dragging) {
  background: var(--c-primary-bg);
  border-color: var(--c-primary-border);
}

.column-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--c-text-3);
  border-radius: var(--radius-sm);
  cursor: grab;
  flex-shrink: 0;
}

.column-drag-handle:hover {
  color: var(--c-text-2);
  background: var(--c-bg);
}

.column-drag-handle:active {
  cursor: grabbing;
}

.column-settings-row__checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--c-primary);
  justify-self: center;
}

.column-settings-row--dragging {
  opacity: 0.92;
  background: var(--c-primary-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border-color: var(--c-primary-border);
  z-index: 1;
}

.column-settings-row-main {
  min-width: 0;
}

.column-settings-row-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  min-width: 0;
}

.column-settings-row-title > span:first-child {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--c-text);
}

.column-settings-type {
  justify-self: end;
}

.column-settings-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.column-settings-row-error {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0;
}

.column-undo-toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  max-width: min(22rem, calc(100vw - 2rem));
  background: var(--c-text);
  color: #fff;
  font-size: 0.8125rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.column-undo-toast__action {
  flex-shrink: 0;
  padding: 0.2rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-sm);
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.column-undo-toast__action:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ??? Data table viewer (Stage 3.6 MVP) ??????????????????????????????????????? */
/* ???????????: ??? �?????????� ? ???????????? + ?????? ??????? */
.constructor-table-workbench {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

@media (min-width: 960px) {
  .constructor-table-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
    align-items: start;
    gap: 1.25rem 1.5rem;
  }
}

.constructor-table-workbench__preview {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.constructor-table-workbench__preview h3,
.constructor-column-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.constructor-column-panel {
  min-width: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
}

.constructor-column-panel__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.constructor-column-panel__section-title {
  margin: 0;
  font-size: 1rem;
}

.constructor-preview-empty {
  margin: 0;
  padding: 1.25rem 1rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--c-border);
  background: var(--c-bg);
  color: var(--c-text-2);
  font-size: 0.875rem;
  text-align: center;
}

.constructor-preview-empty--action {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ??? Constructor Workspace (Toolbar pattern, Stage 3.8+) ??????????????????? */
/* ???????? constructor-table-workbench: preview ?? ??? ??????, ?????? ? overlay */

.constructor-workspace {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.constructor-workspace--fullscreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--c-bg);
  overflow-y: auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0;
}

.constructor-workspace__preview {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  margin-bottom: 0;
}

.constructor-workspace__preview > .twb-toolbar-wrap {
  margin-bottom: 0;
}

/* ??? Toolbar ?????????????????????????????????????????????????????????????? */

.twb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.4rem 1.25rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
}

.twb-toolbar__status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8125rem;
  color: var(--c-text-2);
  flex-wrap: wrap;
  min-height: 1.5rem;
}

.twb-toolbar__status-sep {
  display: inline-block;
  width: 1px;
  height: 12px;
  background: var(--c-border);
  flex-shrink: 0;
}

.twb-toolbar__status-muted {
  color: var(--c-text-2);
  font-style: italic;
}

.twb-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.twb-toolbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg);
  color: var(--c-text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.twb-toolbar__btn:hover:not(:disabled) {
  background: var(--c-surface);
  border-color: var(--c-text-2);
}

.twb-toolbar__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.twb-toolbar__btn--active {
  background: color-mix(in srgb, var(--c-primary) 12%, transparent);
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.twb-toolbar__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 9px;
  background: var(--c-primary);
  color: #fff;
  line-height: 1;
}

.twb-toolbar__tag-soon {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--c-border);
  color: var(--c-text-2);
  margin-left: 0.1rem;
}

/* ??? Column Tools Modal (compact, tabbed) ????????????????????????????????? */

.col-tools-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  /* ???? ???????? ???? ??????: ??? nav + ??????; ??? ????????? ???????? ?????? ????? */
  padding: clamp(4.5rem, 14vh, 7.5rem) max(0.75rem, env(safe-area-inset-right)) 2rem
    max(0.75rem, env(safe-area-inset-left));
  overflow-y: auto;
}

.col-tools-modal {
  background: var(--c-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  width: 100%;
  max-width: min(720px, calc(100vw - 1.5rem));
  display: flex;
  flex-direction: column;
  /* ???? ??????? ? ?????? ??????? ??????? ??? ??????? */
  max-height: min(92vh, 46rem);
  min-height: 0;
}

.col-tools-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem 0.55rem;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
  gap: 0.5rem;
}

.col-tools-modal__title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
}

.col-tools-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--c-text-2);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.1s, color 0.1s;
}

.col-tools-modal__close:hover {
  background: var(--c-border);
  color: var(--c-text);
}

/* ???????: ???????? `wizard-source-picker__groups` + `wizard-source-picker__tab` (??. WizardSourcePicker) */
.col-tools-modal__tabs {
  flex-shrink: 0;
  padding: 0.5rem 0.85rem 0.65rem;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg);
}

.col-tools-modal__tabs.wizard-source-picker__groups {
  gap: 0.45rem;
}

.col-tools-modal__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.col-tools-tab-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.65rem 0.85rem 0.75rem;
  -webkit-overflow-scrolling: touch;
}

.col-tools-tab-panel[hidden] {
  display: none !important;
}

.col-tools-tab-panel__empty {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.col-tools-tab-panel__bulk-error {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
}

/* ColumnSettingsList inside modal ? ?????? ??????????? max-width */
.col-tools-tab-panel .column-settings-list {
  max-width: none;
}

.formula-column-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.formula-column-panel__hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.formula-column-panel__expression {
  width: 100%;
  min-height: 4.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.4;
  resize: vertical;
  background: var(--c-surface);
  color: var(--c-text);
}

.formula-column-panel__fields {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.formula-column-panel__fields-label {
  font-size: 0.75rem;
}

.formula-column-panel__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 6.5rem;
  overflow-y: auto;
}

.formula-column-panel__chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
}

.formula-column-panel__error {
  margin: 0;
  font-size: 0.8125rem;
}

.formula-cell-error {
  color: var(--c-danger, #c0392b);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  cursor: help;
  border-bottom: 1px dotted currentColor;
}

.tables-runtime-home__lede {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  max-width: 42rem;
}

.tables-runtime-home__panel {
  margin-top: 0.35rem;
}

@media (max-width: 420px) {
  .col-tools-modal {
    max-width: calc(100vw - 1rem);
    max-height: min(92vh, 36rem);
  }
}

.data-table-section {
  margin-top: 0.75rem;
}

/* ??????? ?? ??? ?????? ???????? ? ??? ???????? inset ?? padding section. */
section:has(> .data-table-section) {
  padding-left: 0;
  padding-right: 0;
}

section:has(> .data-table-section) > :not(.data-table-section) {
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}

.data-table-period {
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
}

.data-table-period__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}

.data-table-period__fields label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-text-2);
}

.data-table-period__fields input[type="date"] {
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border-strong);
  font-size: 0.8125rem;
  background: var(--c-surface);
  color: var(--c-text);
}

.data-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  max-width: 100%;
}

/* ????????: ???????????? ????????? ? ????, ?????????????? ? ?? ?????? ? ??????? ???? ??????. */
.data-table-scroll-shell {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  max-height: min(72vh, 900px);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  overflow: hidden;
  position: relative;
}

.data-table-scroll-main {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.data-table-scroll-shell:not(.data-table-scroll-shell--vertical-rail) .data-table-scroll-main {
  display: block;
}

.data-table-scroll-body-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.data-table-scroll-shell--vertical-rail .data-table-scroll-body-col > .data-table-wrap--body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  border: none;
  border-radius: 0;
  max-width: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.data-table-scroll-shell--vertical-rail .data-table-scroll-body-col > .data-table-wrap--body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.data-table-scroll-shell > .data-table-scroll-main > .data-table-wrap--body {
  flex: 1;
  min-height: 0;
  border: none;
  border-radius: 0;
  max-width: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
}

.data-table-scroll-shell:not(.data-table-scroll-shell--vertical-rail) > .data-table-scroll-main > .data-table-wrap--body {
  width: 100%;
}

.data-table-scroll-shell > .data-table-scroll-main > .data-table-wrap--body::-webkit-scrollbar {
  width: 10px;
}

/* ?????????? ?????? ????????? ????? (???????????? ? ??????????????). */
.data-table-v-scroll,
.data-table-h-scroll {
  flex-shrink: 0;
  background: var(--c-bg);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--c-text-3) 45%, transparent) var(--c-bg);
}

.data-table-v-scroll {
  width: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  border-left: 1px solid var(--c-border);
}

.data-table-h-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
  border-top: 1px solid var(--c-border);
  box-shadow: none;
}

.data-table-v-scroll::-webkit-scrollbar {
  width: 10px;
}

.data-table-h-scroll::-webkit-scrollbar {
  height: 10px;
}

.data-table-v-scroll::-webkit-scrollbar-track,
.data-table-h-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.data-table-v-scroll::-webkit-scrollbar-thumb,
.data-table-h-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--c-text-3) 45%, transparent);
  border-radius: 999px;
  border: 2px solid var(--c-bg);
}

.data-table-v-scroll::-webkit-scrollbar-thumb:hover,
.data-table-h-scroll::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--c-text-2) 55%, transparent);
}

.data-table-v-scroll__track {
  width: 1px;
}

.data-table-v-scroll:focus-visible,
.data-table-h-scroll:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: -2px;
}

.data-table-h-scroll--docked {
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.06);
}

.manual-spreadsheet-sheet__scroll-shell.data-table-scroll-shell:not(:has(.data-table-h-scroll--docked))
  > .data-table-h-scroll {
  border-top: 1px solid var(--c-border);
}

.data-table-scroll-shell:has(.data-table-h-scroll--docked) > .data-table-h-scroll {
  position: fixed;
}

.data-table-h-scroll__track {
  height: 1px;
}

.data-table {
  border-collapse: collapse;
  font-size: 0.8125rem;
  min-width: 100%;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.5rem 0.65rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--c-border-strong);
  background: var(--c-bg);
  color: var(--c-text);
  box-shadow: 0 1px 0 var(--c-border);
}

.data-table tbody td {
  padding: 0.45rem 0.65rem;
  vertical-align: top;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
  max-width: 24rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table tbody tr:hover {
  background: var(--c-primary-bg);
}

.data-table-row-number-header,
.data-table-row-number {
  width: 2.75rem;
  min-width: 2.75rem;
  max-width: 2.75rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--c-text-muted, var(--c-text-2));
}

.data-table-row-number-header {
  font-weight: 600;
}

.data-table-empty {
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px dashed var(--c-border-strong);
  background: var(--c-surface);
  font-size: 0.875rem;
  color: var(--c-text-2);
}

.data-table-error {
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-danger-h);
  background: var(--c-danger-bg);
  font-size: 0.875rem;
  color: var(--c-text);
}

.data-table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  color: var(--c-text-2);
}

/* ??? Table view controls (density, zoom, search) ??????????????????????????? */

.twb-toolbar-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.twb-toolbar-wrap--runtime {
  margin-bottom: 0.65rem;
}

.table-view-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
}

.table-view-controls__search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 12rem;
  min-width: 10rem;
  position: relative;
}

.table-view-controls__search-icon {
  color: var(--c-text-2);
  flex-shrink: 0;
}

.table-view-controls__search-input {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  padding: 0.35rem 0.5rem;
}

.table-view-controls__hint {
  font-size: 0.6875rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.table-view-controls__select-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--c-text-2);
}

.table-view-controls__select {
  font-size: 0.8125rem;
  padding: 0.3rem 0.45rem;
  min-width: 6.5rem;
}

.table-view-controls__zoom {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.table-view-controls__zoom-btn {
  padding: 0.35rem 0.45rem;
}

.table-view-controls__zoom-select {
  min-width: 4.5rem;
  text-align: center;
}

.table-view-controls__filter-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.table-view-controls__filter-pick--active {
  background: color-mix(in srgb, var(--c-primary) 14%, var(--c-surface));
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.table-view-presets-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.table-view-presets-trigger--active {
  color: var(--c-primary);
}

.table-view-presets-trigger__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--c-primary-bg);
  color: var(--c-primary);
}

.table-view-presets-popover {
  width: min(22rem, calc(100vw - 1rem));
  padding: 0.75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
  box-shadow: var(--shadow-lg);
}

.table-view-presets-popover__title {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.table-view-presets-popover__hint {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
}

.table-view-presets-popover__save {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.table-view-presets-popover__input {
  flex: 1 1 10rem;
  min-width: 0;
}

.table-view-presets-popover__error {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
}

.table-view-presets-popover__limit,
.table-view-presets-popover__empty {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
}

.table-view-presets-popover__list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  max-height: 14rem;
  overflow: auto;
  border-top: 1px solid var(--c-border);
}

.table-view-presets-popover__item {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  border-bottom: 1px solid var(--c-border);
}

.table-view-presets-popover__apply {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.5rem 0.35rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.table-view-presets-popover__apply:hover {
  background: var(--c-primary-bg);
}

.table-view-presets-popover__name {
  font-size: 0.875rem;
  font-weight: 500;
}

.table-view-presets-popover__meta {
  font-size: 0.75rem;
}

.table-view-presets-popover__delete {
  align-self: center;
  flex-shrink: 0;
}

.data-table-search-meta {
  margin: 0 0 0.45rem;
  font-size: 0.8125rem;
}

.data-table__sortable {
  cursor: pointer;
  user-select: none;
}

.data-table__sortable:hover {
  background: var(--c-primary-bg);
}

.data-table tbody td {
  cursor: cell;
}

.data-table__cell--selected {
  background: color-mix(in srgb, var(--c-primary) 14%, var(--c-surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-primary) 45%, transparent);
}

.data-table-wrap:has(.data-table__cell--selected) {
  user-select: none;
}

.table-col-header {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  position: relative;
}

.table-col-header--sheet {
  width: 100%;
  height: 100%;
}

.table-col-header--data-table {
  justify-content: space-between;
}

.table-col-header__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-col-header__title-input {
  flex: 1;
  min-width: 0;
}

.table-col-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 4px);
  background: transparent;
  color: var(--c-text-2);
  cursor: pointer;
}

.table-col-filter-btn:hover {
  background: var(--c-surface-2, rgba(0, 0, 0, 0.04));
  border-color: var(--c-border);
  color: var(--c-text);
}

.table-col-filter-btn--active {
  background: var(--c-primary-bg);
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.table-col-filter-btn--compact {
  width: 1.35rem;
  height: 1.35rem;
}

.table-col-filter-popover {
  width: min(16rem, calc(100vw - 1rem));
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--c-text, #111827);
  box-shadow: var(--shadow-md);
}

.sheet-column-filter-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10040;
  border: 0;
  padding: 0;
  background: rgba(15, 23, 42, 0.4);
  cursor: default;
}

.sheet-column-filter-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10050;
  width: min(20rem, calc(100vw - 2rem));
  max-height: min(85vh, 32rem);
  overflow: auto;
  transform: translate(-50%, -50%);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

.sheet-column-filter-modal .table-col-filter-popover__select,
.sheet-column-filter-modal .table-col-filter-popover__input {
  background: #fff;
  color: var(--c-text, #111827);
  border: 1px solid var(--c-border, #d1d5db);
}

.table-col-filter-popover__title {
  margin: 0 0 0.55rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-text);
}

.table-col-filter-popover__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.55rem;
}

.table-col-filter-popover__label {
  font-size: 0.75rem;
  color: var(--c-text-2);
}

.table-col-filter-popover__select,
.table-col-filter-popover__input {
  width: 100%;
  font-size: 0.8125rem;
}

.table-col-filter-popover__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.table-col-filter-popover__section {
  margin-bottom: 0.65rem;
  padding-top: 0.15rem;
  border-top: 1px solid var(--c-border);
}

.table-col-filter-popover__sort-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
}

.table-col-filter-popover__sort-btn {
  justify-content: flex-start;
  text-align: left;
}

.table-col-filter-popover__sort-btn--active {
  background: var(--c-primary-bg);
  color: var(--c-primary);
}

.table-selection-status-slot {
  flex-shrink: 0;
  min-height: 2.125rem;
  border-top: 1px solid var(--c-border);
  background: var(--c-bg);
}

.table-selection-status-slot:not([aria-hidden='false']) {
  border-top-color: transparent;
}

.table-selection-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--c-text-2);
  background: transparent;
}

.table-selection-status__range {
  font-weight: 600;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

.table-selection-status__item strong {
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

.table-selection-status__sep {
  opacity: 0.45;
}

.table-view .data-table-scroll-shell,
.table-view.data-table-scroll-shell {
  max-height: min(72vh, 900px);
}

.table-view .data-table-scroll-shell > .data-table-scroll-main > .data-table-wrap--body {
  max-height: none;
}

.table-view--density-compact .data-table tbody td,
.table-view--density-compact .data-table thead th,
.table-view--density-compact .manual-spreadsheet-sheet__table td,
.table-view--density-compact .manual-spreadsheet-sheet__table th {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.table-view--density-spacious .data-table tbody td,
.table-view--density-spacious .data-table thead th,
.table-view--density-spacious .manual-spreadsheet-sheet__table td,
.table-view--density-spacious .manual-spreadsheet-sheet__table th {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.table-view--zoom-75 {
  font-size: 75%;
}

.table-view--zoom-100 {
  font-size: 100%;
}

.table-view--zoom-125 {
  font-size: 125%;
}

.table-view--zoom-150 {
  font-size: 150%;
}

@keyframes data-table-skeleton-pulse {
  50% {
    opacity: 0.45;
  }
}

.data-table-skeleton-row {
  pointer-events: none;
}

.data-table-skeleton-cell {
  padding: 0.5rem 0.65rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--c-border);
}

.data-table-skeleton-cell__stub {
  display: block;
  height: 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--c-border-strong);
  min-width: 4rem;
  animation: data-table-skeleton-pulse 1s ease-in-out infinite;
}

/* ??? Load control (viewer, Stage 3.7a) ????????????????????????????????????? */
.load-control-panel {
  margin: 0 0 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}

.load-control-panel__header {
  margin-bottom: 0.15rem;
}

.load-control-panel__summary strong {
  color: var(--c-text);
  font-weight: 600;
}

.load-control-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.load-control-panel__actions .btn-secondary[aria-pressed='true'] {
  border-color: var(--c-primary, #7c3aed);
  background: var(--c-primary-bg, #f5f3ff);
  color: var(--c-primary, #7c3aed);
}

/* ??? Table runtime banners (Stage 3.10j) ??????????????????????????????????? */
.table-runtime-banner {
  margin: 0 0 0.85rem 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}

.table-runtime-banner__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.table-runtime-banner__title {
  margin: 0 0 0.25rem 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--c-text);
}

.table-runtime-banner__text {
  margin: 0 0 0.5rem 0;
  font-size: 0.875rem;
  color: var(--c-text-2);
  line-height: 1.45;
}

.table-runtime-banner--loading {
  border-color: color-mix(in srgb, var(--c-primary) 35%, var(--c-border));
  background: color-mix(in srgb, var(--c-primary) 6%, var(--c-surface));
}

.table-runtime-banner--error {
  border-color: color-mix(in srgb, var(--c-danger) 45%, var(--c-border));
  background: color-mix(in srgb, var(--c-danger) 6%, var(--c-surface));
}

.table-runtime-banner--warning {
  border-color: color-mix(in srgb, var(--c-warning, #d97706) 40%, var(--c-border));
  background: color-mix(in srgb, var(--c-warning, #d97706) 6%, var(--c-surface));
}

.table-runtime-banner--empty {
  border-style: dashed;
}

.demo-rows-dev-action {
  margin: 0 0 1rem 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  border: 1px dashed color-mix(in srgb, var(--c-text-2) 35%, var(--c-border));
  background: color-mix(in srgb, var(--c-text-2) 4%, var(--c-surface));
}

.demo-rows-dev-action__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.demo-rows-dev-action__badge {
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
}

.demo-rows-dev-action__hint {
  margin: 0 0 0.65rem 0;
  font-size: 0.8125rem;
  line-height: 1.45;
}

/* ??? Published table runtime (Stage 3.10j UX) ????????????????????????????? */
.table-runtime-page {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.table-runtime-page__empty {
  padding: 1rem 0;
}

.table-runtime-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.15rem 0 0.35rem;
}

.table-runtime-header__main {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.table-runtime-header__back {
  flex-shrink: 0;
  margin-top: 0.15rem;
  padding-inline: 0.45rem;
}

.table-runtime-header__titles {
  min-width: 0;
}

.table-runtime-header__name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-runtime-header__meta {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  color: var(--c-text-2);
  line-height: 1.4;
}

.table-runtime-header__meta-sep {
  margin: 0 0.35rem;
  opacity: 0.65;
}

.table-runtime-header__rows {
  color: var(--c-text);
  font-weight: 500;
}

.table-runtime-header__actions {
  flex-shrink: 0;
}

.table-runtime__workspace {
  margin-top: 0;
  gap: 0.5rem;
}

.table-runtime__data {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.table-runtime-load {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
  overflow: hidden;
}

.table-runtime-load__trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.table-runtime-load__trigger:hover {
  background: color-mix(in srgb, var(--c-text-2) 5%, var(--c-surface));
}

.table-runtime-load__chevron {
  flex-shrink: 0;
  color: var(--c-text-2);
  transition: transform 0.15s ease;
}

.table-runtime-load--open .table-runtime-load__chevron {
  transform: rotate(180deg);
}

.table-runtime-load__trigger-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.table-runtime-load__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text);
}

.table-runtime-load__summary {
  font-size: 0.8125rem;
  color: var(--c-text-2);
}

.table-runtime-load__hint {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--c-primary);
  font-weight: 500;
}

.table-runtime-load__panel {
  padding: 0 0.75rem 0.75rem;
  border-top: 1px solid var(--c-border);
}

.table-runtime-load__panel[hidden] {
  display: none;
}

.table-runtime-more {
  position: relative;
}

.table-runtime-more__trigger {
  padding-inline: 0.5rem;
}

.table-runtime-more__menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 120;
  min-width: 14rem;
  padding: 0.35rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
  box-shadow: var(--shadow-md);
}

.table-runtime-more__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-text);
  font-size: 0.8125rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.table-runtime-more__item:hover:not(:disabled) {
  background: color-mix(in srgb, var(--c-text-2) 6%, var(--c-surface));
}

.table-runtime-more__item:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.table-runtime-more__item--dev {
  color: var(--c-text-2);
}

.table-runtime-more__dev-tag {
  font-size: 0.625rem;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
}

.twb-toolbar--runtime {
  margin-top: 0;
}

.twb-toolbar__status--runtime {
  font-weight: 500;
}

.load-control-panel__last-job {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
}

/* Pre-start load modal (Stage 3.7g-c) */
.load-preflight-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.load-preflight-modal__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  cursor: default;
  background: var(--c-text);
  opacity: 0.38;
}

/* ???? backdrop (div): ?? ????????????; ?????? button ??????? ????? ? ?????????? :focus-visible. */
.load-preflight-modal__backdrop:focus,
.load-preflight-modal__backdrop:focus-visible {
  outline: none;
}

.load-preflight-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  max-height: min(90vh, 640px);
  overflow: auto;
  padding: 1rem 1.1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  box-shadow: var(--shadow-md);
}

.load-preflight-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.load-preflight-period-strong {
  color: var(--c-text);
  font-weight: 600;
}

.load-preflight-summary {
  margin: 0;
  display: grid;
  gap: 0.35rem;
  font-size: 0.8125rem;
}

.load-preflight-summary--loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.load-preflight-summary__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 0.35rem;
}

.load-preflight-summary__row:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.load-preflight-summary__row dt {
  margin: 0;
  color: var(--c-text-2);
  font-weight: 400;
}

.load-preflight-summary__row dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}

.load-preflight-warning {
  border-left: 3px solid var(--c-warning-border);
  padding-left: 0.65rem;
}

.load-preflight-actions {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.load-preflight-actions__group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
}

.load-preflight-actions__group button {
  width: 100%;
  justify-content: center;
}

.load-preflight-cancel {
  align-self: flex-start;
}

/* Clear period confirm (Stage 3.7g-d) ? overlay ??? ? load-preflight */
.clear-period-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.clear-period-modal__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  cursor: default;
  /* ?????????? ???? ??? element opacity ? ????? ???????????? hover ????? ??? ???????? */
  background: color-mix(in srgb, var(--c-text) 38%, transparent);
  opacity: 1;
  box-shadow: none;
}

/* ClearPeriodConfirmModal ??? ??? ?????????? button-backdrop */
button.clear-period-modal__backdrop {
  min-height: 0;
}

button.clear-period-modal__backdrop:hover:not(:disabled),
button.clear-period-modal__backdrop:focus,
button.clear-period-modal__backdrop:focus-visible {
  background: color-mix(in srgb, var(--c-text) 38%, transparent);
  border: none;
  box-shadow: none;
  outline: none;
}

.clear-period-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  padding: 1rem 1.1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  box-shadow: var(--shadow-md);
}

.clear-period-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.clear-period-card__period {
  color: var(--c-text);
  font-weight: 600;
}

.clear-period-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.load-job-status {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  font-size: 0.8125rem;
}

.load-job-status--running {
  border-color: var(--c-primary-border);
  background: var(--c-primary-bg);
}

.load-job-status--done {
  border-color: var(--c-success);
  background: var(--c-success-bg);
}

.load-job-status--error {
  border-color: var(--c-danger-h);
  background: var(--c-danger-bg);
}

.load-job-status--canceled {
  border-color: var(--c-border-strong);
  background: var(--c-bg);
}

.load-job-progress {
  margin-top: 0.55rem;
}

.load-job-progress__bar {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--c-border-strong);
  overflow: hidden;
}

.load-job-progress__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--c-primary);
  transition: width 0.35s ease;
}

.load-job-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.35rem;
}

.load-job-meta strong ~ * {
  font-weight: 400;
}

.load-job-status > .load-job-meta:first-child {
  margin-top: 0;
}

.load-job-meta strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.8125rem;
  color: var(--c-text);
}

.load-job-error {
  margin: 0;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-danger-h);
  background: var(--c-danger-bg);
  color: var(--c-danger-h);
  font-size: 0.8125rem;
}

.load-job-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.load-job-status .btn-secondary.btn-sm {
  margin-top: 0;
}

/* ??? Date status bar (viewer, Stage 3.7b) ?????????????????????????????????? */
.date-status-bar {
  margin: 0.65rem 0 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}

.date-status-bar__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
}

.date-status-bar__header strong {
  font-size: 0.8125rem;
  color: var(--c-text);
}

.date-status-bar__horizon {
  font-size: 0.75rem;
}

.date-status-bar__summary {
  margin: 0.5rem 0 0.45rem;
}

.date-status-bar__summary-line {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.date-status-bar__summary-line:first-child {
  margin-top: 0;
}

.date-status-bar__strip {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 0.5rem;
}

.date-status-day {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}

.date-status-day--loaded {
  background: var(--c-success);
}

.date-status-day--loading {
  background: var(--c-primary);
  animation: date-status-day-pulse 1.1s ease-in-out infinite;
}

.date-status-day--not-loaded {
  background: var(--c-border-strong);
}

.date-status-day--unavailable {
  background: var(--c-text-3);
  opacity: 0.85;
}

.date-status-day--empty-review {
  background: #fbbf24;
  opacity: 0.95;
}

.date-status-day--empty-confirmed {
  background: var(--c-success);
  opacity: 0.38;
}

.date-status-day--error {
  background: var(--c-danger-h);
}

@keyframes date-status-day-pulse {
  50% {
    opacity: 0.45;
  }
}

.date-status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--c-text-2);
}

.date-status-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.date-status-legend__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.date-status-legend__dot--loaded {
  background: var(--c-success);
}

.date-status-legend__dot--loading {
  background: var(--c-primary);
  animation: date-status-day-pulse 1.1s ease-in-out infinite;
}

.date-status-legend__dot--not-loaded {
  background: var(--c-border-strong);
}

.date-status-legend__dot--unavailable {
  background: var(--c-text-3);
  opacity: 0.85;
}

.date-status-legend__dot--empty-review {
  background: #fbbf24;
}

.date-status-legend__dot--empty-confirmed {
  background: var(--c-success);
  opacity: 0.45;
}

.date-status-legend__dot--error {
  background: var(--c-danger-h);
}

.date-status-bar__error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin-top: 0.45rem;
  font-size: 0.8125rem;
  color: var(--c-danger-h);
}

.date-status-bar__loading {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.45rem;
  font-size: 0.8125rem;
}

/* ??? Date range calendar widget (Stage 3.7c) ?????????????????????????????? */

/* Wrapper */
.date-range-widget {
  position: relative;
  display: inline-block;
  margin-bottom: 0.75rem;
}

/* Trigger ? ????? ????????????? button.*, ????? ?????????? ?????????? button:hover (primary) */
button.date-range-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: auto; /* ????? ??????????? button */
  padding: 0.45rem 0.75rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, background 0.15s;
}

button.date-range-trigger:hover:not(:disabled) {
  border-color: var(--c-primary-border);
  background: var(--c-bg);
  color: var(--c-text);
}

button.date-range-trigger.date-range-trigger--open:not(:disabled) {
  border-color: var(--c-primary-border);
  background: var(--c-bg);
  color: var(--c-text);
}

.date-range-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.date-range-trigger__label {
  color: var(--c-text);
  white-space: nowrap;
}

.date-range-trigger__icon {
  color: var(--c-text-3);
  flex-shrink: 0;
}

/*
 * ?????? ?????? = ??????? + ??????? (~152px) + ????????? (285px) + ??????? ? 462px,
 * ??? ??????? ???? ?????? ?? ??????.
 */
.date-range-popover {
  z-index: 1200;
  box-sizing: border-box;
  width: min(462px, calc(100vw - 16px));
  max-width: 462px;
  max-height: calc(100vh - 16px);
  padding: 0.75rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow-x: hidden;
  overflow-y: auto;
}

/* ?????: ???? ?????? ? ??????, ??? date, ??????? */
.date-range-popup-header {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.35rem 0.45rem;
  padding-bottom: 0.65rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid var(--c-border);
  min-width: 0;
}

.date-range-popup-header__title {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--c-text);
  flex-shrink: 0;
}

.date-range-popup-header__inputs {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.3rem;
  flex: 1 1 auto;
  min-width: 0;
}

.date-range-popup-header__field {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  flex-shrink: 0;
}

.date-range-popup-header__field-label {
  font-size: 0.75rem;
  color: var(--c-text-3);
}

.date-range-popup-header__sep {
  color: var(--c-text-3);
  font-size: 0.8125rem;
}

.date-range-popup-header__inputs input[type="date"] {
  box-sizing: border-box;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 0.8125rem;
  width: 112px;
  min-width: 104px;
  max-width: 112px;
  flex-shrink: 0;
}

.date-range-popup-header__spacer {
  flex: 1 1 auto;
  min-width: 0.25rem;
}

button.date-range-popup-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  min-height: auto;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-text-3);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: none;
  transition: background 0.12s, color 0.12s;
}

button.date-range-popup-close:hover:not(:disabled) {
  background: var(--c-bg);
  color: var(--c-text);
}

@media (max-width: 420px) {
  .date-range-popup-header {
    flex-wrap: wrap;
  }

  .date-range-popup-header__inputs {
    flex-wrap: wrap;
  }
}

.date-range-popup-header__error {
  width: 100%;
  margin: -0.35rem 0 0.5rem;
  font-size: 0.75rem;
  color: var(--c-danger);
}

/* ????: ??????? ?????, ????????? ?????? (legacy) */
.date-range-popup-body {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.date-range-sidebar {
  width: 130px;
  flex-shrink: 0;
  padding-right: 0.65rem;
  margin-right: 0.65rem;
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  /* ?????? ????? ????????? ? ?????? ?????? ????????? */
  gap: 0.48rem;
  align-self: stretch;
  min-height: 0;
}

.date-range-sidebar-presets {
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
  flex: 0 1 auto;
  /* ????? ????????? ?????? ?? �?????� ? ??????????? ? ?????????? */
  padding-bottom: 0.08rem;
}

.date-range-sidebar-horizon {
  margin-top: auto;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
  padding: 0.48rem 0.18rem 0.08rem;
  font-size: 0.62rem;
  line-height: 1.35;
  text-align: center;
  border-top: 1px solid color-mix(in srgb, var(--c-border) 65%, transparent);
}

.date-range-preset-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ????? ?????????? ???????? (?????? | ????? | ???????) ? ???????, ??? �????????? ? ??????� */
.date-range-preset-band-divider {
  margin: 0.2rem 0 0.24rem;
  border: none;
  border-top: 1px solid color-mix(in srgb, var(--c-border) 80%, transparent);
  align-self: stretch;
}

.date-range-preset-group__title {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: 0.035em;
  padding: 0 0.22rem;
  /* ?????? ??? ????????????? (????????? / ???????) ?? ?????? ?????? */
  margin-bottom: 0.34rem;
  line-height: 1.2;
}

/* ????????????? button.* ? ????? ?????????? button:hover ???? ?????? primary */
button.date-range-preset-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.18rem 0.28rem;
  min-height: auto; /* ????? ??????????? button { min-height: 33px } ? ????? �????????????� ??????? */
  gap: 0; /* ????? ??????????? button { gap } */
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--c-text-2);
  cursor: pointer;
  text-align: left;
  white-space: normal;
  line-height: 1.18;
  box-shadow: none;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

button.date-range-preset-btn:hover:not(:disabled) {
  background: var(--c-bg);
  border-color: var(--c-primary-border);
  color: var(--c-text);
}

button.date-range-preset-btn.date-range-preset-btn--active:not(:disabled) {
  background: var(--c-primary-bg);
  border-color: transparent;
  color: var(--c-primary);
  font-weight: 600;
}

/* ?????? ??? ???? ??????? ?????? ??? layout �760px + 2 ??????�: (760 ? pad ? ??????? ? gap) / 2 ? 285px */
.date-range-daypicker-wrap {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 285px;
}

/* ?????: ??????? + ????????? + ?????? */
.date-range-popup-footer {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--c-border);
}

.date-range-popup-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.date-range-footer-hint {
  font-size: 0.78rem;
  color: var(--c-text-3);
  flex: 1;
  min-width: 8rem;
}

.date-range-popup-footer-buttons {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-left: auto;
}

button.date-range-status-pill {
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  min-height: auto;
  gap: 0.25rem;
  padding: 0.22rem 0.58rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--c-border-strong);
  background: var(--c-bg);
  color: var(--c-text-2);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

button.date-range-status-pill:hover:not(:disabled) {
  border-color: var(--c-primary-border);
  color: var(--c-text);
}

button.date-range-status-pill.date-range-status-pill--on {
  border-color: var(--c-primary-border);
  background: var(--c-primary-bg);
  color: var(--c-primary);
}

button.date-range-status-pill:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* Legend */
.date-range-popup-footer .date-range-legend {
  padding-bottom: 0.55rem;
  margin-bottom: 0.35rem;
}

.date-range-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
  font-size: 0.75rem;
  color: var(--c-text-2);
}

.date-range-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.date-range-legend__dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.date-range-legend__dot--loaded      { background: var(--c-success); }
.date-range-legend__dot--loading     { background: var(--c-primary); animation: date-status-day-pulse 1.1s ease-in-out infinite; }
.date-range-legend__dot--not-loaded  { background: var(--c-border-strong); }
.date-range-legend__dot--unavailable { background: var(--c-text-3); }
.date-range-legend__dot--empty-review { background: #fbbf24; }
.date-range-legend__dot--empty-confirmed { background: var(--c-success); opacity: 0.45; }
.date-range-legend__dot--error       { background: var(--c-danger-h); }

/* ??? DayPicker (classNames.root = date-range-rdp), ??? ??????????? ?????? ??????? ??? */
.date-range-rdp .rdp-months {
  display: flex;
  gap: 1rem;
}

.date-range-rdp .rdp-month {
  flex: 0 1 auto;
  min-width: 0;
}

.date-range-rdp .rdp-month_grid {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.date-range-rdp tbody tr:hover,
.date-range-rdp .rdp-week:hover {
  background: transparent !important;
}

.date-range-rdp .rdp-month_grid td,
.date-range-rdp .rdp-month_grid th {
  padding: 0;
  border: none;
  vertical-align: middle;
  box-sizing: border-box;
}

.date-range-rdp .rdp-weekdays th {
  padding: 0.35rem 0 0.12rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-3);
  background: transparent;
  border: none;
  vertical-align: bottom;
}

.date-range-rdp {
  --rdp-accent-color: var(--c-primary);
  --rdp-accent-background-color: var(--c-primary-bg);
  --rdp-selected-border: none;
  --rdp-range_middle-background-color: transparent;
  --rdp-day_button-border-radius: 50%;
  --rdp-day-height: 38px;
  --rdp-day-width: 38px;
  --rdp-day_button-height: 36px;
  --rdp-day_button-width: 36px;
  --rdp-outside-opacity: 1;
  --rdp-today-color: var(--c-primary);
  font-size: 0.82rem;
  width: 100%;
}

.date-range-rdp .rdp-month_caption {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.48rem;
}

.date-range-rdp .rdp-caption_label {
  text-align: center;
}

.date-range-rdp .rdp-weekday {
  font-size: 0.75rem;
  color: var(--c-text-3);
  text-align: center;
}

.date-range-rdp .rdp-day {
  width: var(--rdp-day-width);
  height: var(--rdp-day-height);
  box-sizing: border-box;
}

.date-range-rdp .rdp-range_start,
.date-range-rdp .rdp-range_end {
  background: none !important;
}

.date-range-rdp .rdp-outside {
  opacity: 0.42;
  color: var(--c-text-3);
}

.date-range-rdp .rdp-outside.rdp-range_middle {
  opacity: 1;
}

.date-range-rdp .rdp-outside.rdp-range_middle .rdp-day-num {
  color: var(--c-text-2);
}

.date-range-rdp .rdp-outside.rdp-range_start .rdp-day_button,
.date-range-rdp .rdp-outside.rdp-range_end .rdp-day_button {
  color: var(--c-surface);
}

.date-range-rdp .rdp-range_start .rdp-day_button,
.date-range-rdp .rdp-range_end .rdp-day_button {
  background: var(--c-primary);
  color: var(--c-surface);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
}

.date-range-rdp .rdp-range_middle .rdp-day_button {
  background: transparent;
  border: 1.5px solid var(--c-primary);
  color: var(--c-text);
  border-radius: var(--radius-full);
  font-weight: 400;
}

.date-range-rdp .rdp-day_button {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--rdp-day_button-width);
  height: var(--rdp-day_button-height);
  min-width: var(--rdp-day_button-width);
  min-height: var(--rdp-day_button-height);
  margin: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--c-border) 45%, var(--c-surface));
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: var(--rdp-day_button-border-radius);
}

/* ??????????? ??? ???????? ??????? ? ??? ??????; ???????? ???????? ???? ?? ????????????? */
.date-range-rdp td.rdp-outside:not(.rdp-range_start):not(.rdp-range_end):not(.rdp-range_middle) .rdp-day_button {
  border: none;
}

.date-range-rdp .rdp-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.15rem;
  margin-bottom: 0.45rem;
}

.date-range-rdp button.rdp-button_previous,
.date-range-rdp button.rdp-button_next {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  color: var(--c-text-3);
  cursor: pointer;
  box-shadow: none;
}

.date-range-rdp button.rdp-button_previous:hover:not(:disabled),
.date-range-rdp button.rdp-button_next:hover:not(:disabled) {
  background: var(--c-bg);
  color: var(--c-text);
}

/* RDP ?? ????????? 24�24 ? ?????????? ?????????? ?????? svg ? ?????? */
.date-range-rdp .rdp-chevron {
  width: 14px !important;
  height: 14px !important;
}

.date-range-rdp .rdp-button_previous svg,
.date-range-rdp .rdp-button_next svg {
  width: 14px !important;
  height: 14px !important;
  display: block;
}

.date-range-rdp .rdp-day_button:hover {
  background: var(--c-primary-bg);
  border-color: var(--c-primary-border);
}

.date-range-rdp td.rdp-outside:not(.rdp-range_start):not(.rdp-range_end):not(.rdp-range_middle) .rdp-day_button:hover {
  border: none;
}

.date-range-rdp .rdp-range_start .rdp-day_button:hover,
.date-range-rdp .rdp-range_end .rdp-day_button:hover {
  background: var(--c-primary-h);
  color: var(--c-surface);
  border: none;
}

.date-range-rdp .rdp-range_middle .rdp-day_button:hover {
  background: var(--c-primary-bg);
  border-color: var(--c-primary-h);
  color: var(--c-text);
}

.date-range-rdp .rdp-day_button:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.date-range-rdp button.rdp-button_previous:focus-visible,
.date-range-rdp button.rdp-button_next:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.date-range-rdp .rdp-day-num {
  line-height: 1;
  font-size: 0.82rem;
}

.date-range-rdp .date-range-day-dot {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}

.date-range-rdp .rdp-selected {
  font-weight: inherit;
  font-size: inherit;
}

.date-range-day-dot {
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  pointer-events: none;
}

/*
 * ???? span ????? ??? ?????? ? ????? ????????? ????????. Pulse ?????? ? ???????.
 */
.date-range-rdp .date-range-day-dot.date-range-day-status-loaded {
  background: var(--c-success);
}
.date-range-rdp .date-range-day-dot.date-range-day-status-loading {
  background: var(--c-primary);
}
.date-range-rdp .date-range-day-dot.date-range-day-status-not-loaded {
  background: var(--c-border-strong);
}
.date-range-rdp .date-range-day-dot.date-range-day-status-unavailable {
  background: var(--c-text-3);
  opacity: 0.9;
}

.date-range-rdp .date-range-day-dot.date-range-day-status-empty-review {
  background: #fbbf24;
}

.date-range-rdp .date-range-day-dot.date-range-day-status-empty-confirmed {
  background: var(--c-success);
  opacity: 0.42;
}

.date-range-rdp .date-range-day-dot.date-range-day-status-error {
  background: var(--c-danger-h);
}

@media (max-width: 800px) {
  .date-range-popup-body {
    flex-direction: column;
  }

  .date-range-sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding-right: 0;
    margin-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    padding-bottom: 0.65rem;
    margin-bottom: 0.65rem;
  }

  .date-range-preset-group {
    flex: 1 1 auto;
    min-width: 120px;
  }

  .date-range-sidebar-horizon {
    flex-basis: 100%;
    width: 100%;
    margin-top: 0.55rem;
    margin-left: 0;
    margin-right: 0;
  }
}

/* .data-table-period* ????????? ??? ??????????? ????????. TODO: ??????? ????? Stage 3.7c */

/* ??? Stage 2 placeholder ???????????????????????????????????????????????????? */
.stage-placeholder {
  padding: 1rem 1.25rem;
  background: var(--c-warning-bg);
  border: 1px solid var(--c-warning-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--c-warning-text);
}

/* ???????????????????????????????????????????????????????????????????????????
   Constructor shared visual pattern (Phase 1)
   ? ConstructorToolbar, ConstructorStatusBadge, ConstructorEmptyState
   ? TreeSummary count & warning variant
   ? Source catalog title normalization
   ??????????????????????????????????????????????????????????????????????????? */

/* ??? ConstructorToolbar ??????????????????????????????????????????????????? */
.constructor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.constructor-toolbar__search {
  flex: 1 1 220px;
  min-width: 160px;
  max-width: 360px;
  min-height: 33px;
  padding: 0.3rem 0.6rem;
  box-sizing: border-box;
  font-size: 0.8125rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg);
  color: var(--c-text);
  outline: none;
  -webkit-appearance: none;
}

.constructor-toolbar__search::placeholder {
  color: var(--c-text-2);
  opacity: 0.75;
}

.constructor-toolbar__search:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px var(--c-primary-bg);
}

.constructor-toolbar__filter {
  min-width: 130px;
  max-width: 190px;
  min-height: 33px;
  padding: 0.3rem 1.8rem 0.3rem 0.6rem;
  box-sizing: border-box;
  font-size: 0.8125rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background-color: var(--c-bg);
  /* Chevron arrow visible at rest ? inline SVG as background */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 14px 14px;
  color: var(--c-text);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.constructor-toolbar__filter:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px var(--c-primary-bg);
}

.constructor-toolbar__empty-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.constructor-toolbar__empty-toggle-label {
  font-size: 0.8125rem;
  color: var(--c-text-2);
  user-select: none;
  white-space: nowrap;
}

.constructor-toolbar__empty-toggle {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  min-height: unset;
  padding: 0;
  border: none;
  border-radius: 9px;
  background: var(--c-border);
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
  vertical-align: middle;
}

.constructor-toolbar__empty-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s;
}

.constructor-toolbar__empty-toggle--active {
  background: var(--c-primary);
}

.constructor-toolbar__empty-toggle--active::after {
  transform: translateX(14px);
}

.constructor-toolbar__tree-controls {
  display: flex;
  gap: 0.3rem;
}

/* ??? TreeSummary count badge ?????????????????????????????????????????????? */
.constructor-home__tree-summary-count {
  display: inline-block;
  font-size: 0.695rem;
  font-weight: 500;
  color: var(--c-text-2);
  background: color-mix(in srgb, var(--c-surface) 100%, transparent);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 0 0.38rem;
  line-height: 1.55;
  margin-right: 0.35rem;
  vertical-align: middle;
  letter-spacing: 0;
}

/* ??? Warning tree node (? ???????? ?? ???????) ???????????????????????????? */
.constructor-home__tree-node--warning > summary {
  background: var(--c-warning-bg, #fef3c7);
  border-left: 3px solid var(--c-warning-border, #fcd34d);
  padding-left: calc(0.5rem - 3px);
}

.constructor-home__tree-summary--warning .constructor-home__tree-summary-label {
  color: var(--c-warning-text, #92400e);
}

/* ??? ObjectTree (????? ??????? ?????? ????????) ??????????????????????????? */
.object-tree {
  margin: 0;
  padding: 0;
  min-width: 0;
  box-sizing: border-box;
}

.object-tree--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 8.5rem;
  padding: 0.35rem;
  border: 1px solid var(--c-border-strong, #d1d5db);
  border-radius: var(--radius-sm, 6px);
  background: var(--c-surface, #fff);
  box-shadow: var(--shadow-sm);
}

.object-tree__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.object-tree__node {
  list-style: none;
  min-width: 0;
}

.object-tree__children {
  margin: 0.1rem 0 0.1rem 0.75rem;
  padding-left: 0.5rem;
  list-style: none;
  border-left: 1px solid color-mix(in srgb, var(--c-border) 50%, transparent);
}

button.object-tree__row {
  display: grid;
  grid-template-columns: var(--object-tree-caret-col, 14px) var(--object-tree-icon-col, 16px) minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.35rem;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.3rem 0.4rem;
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.25;
  text-align: left;
  color: var(--c-text);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  box-shadow: none;
  transition: background 0.1s ease, color 0.1s ease;
}

button.object-tree__row:hover:not(:disabled) {
  background: var(--c-surface-2, #f4f4f5);
}

button.object-tree__row:focus-visible {
  outline: 2px solid var(--c-focus, #2563eb);
  outline-offset: 0;
}

button.object-tree__row:disabled {
  cursor: default;
  opacity: 0.6;
}

button.object-tree__toggle {
  font-weight: 600;
}

/* ???????? ????? ? ?????? ? ??????? ?????????? ?????? primary. */
button.object-tree__toggle[aria-expanded="true"] .object-tree__caret,
button.object-tree__toggle[aria-expanded="true"] .object-tree__icon {
  color: var(--c-primary, #2563eb);
}

/* ???????? ????? ? ????????? ??? ? ??????, ?? ??? �???????????� ??????. */
.object-tree__node--folder-active > .object-tree__folder-drop-wrap > .object-tree__row-wrap > button.object-tree__toggle,
.object-tree__node--folder-active > .object-tree__row-wrap > button.object-tree__toggle {
  color: var(--c-primary, #2563eb);
  background: color-mix(in srgb, var(--c-primary, #2563eb) 8%, var(--c-surface, #fff));
}

button.object-tree__row--active {
  font-weight: 500;
  color: var(--c-primary, #2563eb);
  background: color-mix(in srgb, var(--c-primary, #2563eb) 8%, var(--c-surface, #fff));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-primary, #2563eb) 45%, transparent);
}

button.object-tree__row--active:hover:not(:disabled) {
  background: color-mix(in srgb, var(--c-primary, #2563eb) 12%, var(--c-surface, #fff));
}

.object-tree__caret-slot {
  width: var(--object-tree-caret-col, 14px);
  min-width: var(--object-tree-caret-col, 14px);
  height: var(--object-tree-caret-col, 14px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.object-tree__caret-slot--leaf {
  pointer-events: none;
}

.object-tree__caret {
  flex-shrink: 0;
  color: var(--c-text-3, #a1a1aa);
  transition: transform 0.12s ease;
  transform-origin: center center;
}

.object-tree__caret--open {
  transform: rotate(90deg);
}

.object-tree__icon-slot {
  width: var(--object-tree-icon-col, 16px);
  min-width: var(--object-tree-icon-col, 16px);
  height: var(--object-tree-icon-col, 16px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.object-tree__icon-slot--empty {
  pointer-events: none;
}

.object-tree__icon {
  display: inline-flex;
  color: var(--c-text-2);
}

.object-tree__icon-slot--invalid .object-tree__invalid-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-danger, #b91c1c);
}

button.object-tree__row--active .object-tree__icon {
  color: var(--c-primary, #2563eb);
}

.object-tree__caret-slot {
  grid-column: 1;
}

.object-tree__icon-slot {
  grid-column: 2;
}

.object-tree__content {
  grid-column: 3;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.object-tree__badge {
  grid-column: 4;
}

.object-tree__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.object-tree__subtitle {
  font-size: 0.75rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.object-tree__count {
  display: none;
}

.object-tree__badge {
  display: inline-flex;
  align-items: center;
  justify-self: end;
}

.object-tree__actions {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  width: var(--object-tree-actions-col, 22px);
  min-width: var(--object-tree-actions-col, 22px);
  margin-left: 0;
  opacity: 1;
  pointer-events: none;
}

.object-tree__row-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--object-tree-actions-col, 22px);
  align-items: center;
  column-gap: 0.15rem;
  min-width: 0;
  position: relative;
}

.object-tree__row-wrap--cols-3 {
  grid-template-columns: var(--object-tree-drag-col, 1.25rem) minmax(0, 1fr) var(--object-tree-actions-col, 22px);
}

.object-tree__row-wrap--cols-3 > button.object-tree__drag-handle {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
}

.object-tree__row-wrap--cols-3 > button.object-tree__row,
.object-tree__row-wrap--cols-3 > button.object-tree__toggle,
.object-tree__row-wrap--cols-3 > .object-tree__row-main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.object-tree__row-main {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
}

.object-tree__row-main > button.object-tree__row,
.object-tree__row-main > button.object-tree__toggle {
  flex: 1 1 auto;
  min-width: 0;
}

.object-tree__selection-check {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}

.object-tree__selection-check-input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--c-primary);
  cursor: pointer;
}

.object-tree__selection-check-input:focus-visible {
  outline: 2px solid var(--c-focus, #2563eb);
  outline-offset: 1px;
}

.object-tree__row-wrap--cols-3 > .object-tree__actions {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.object-tree__row-wrap:not(.object-tree__row-wrap--cols-3) > button.object-tree__row,
.object-tree__row-wrap:not(.object-tree__row-wrap--cols-3) > button.object-tree__toggle,
.object-tree__row-wrap:not(.object-tree__row-wrap--cols-3) > .object-tree__row-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.object-tree__row-wrap:not(.object-tree__row-wrap--cols-3) > .object-tree__actions {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

button.object-tree__drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--object-tree-drag-col, 1.25rem);
  min-width: var(--object-tree-drag-col, 1.25rem);
  height: var(--object-tree-drag-col, 1.25rem);
  padding: 0;
  margin: 0;
  border: none;
  border-radius: var(--radius-sm, 4px);
  background: transparent;
  color: var(--c-text-muted);
  cursor: grab;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  touch-action: none;
  transition: opacity 0.1s ease, visibility 0.1s ease, color 0.1s ease, background 0.1s ease;
}

@media (hover: hover) {
  .object-tree__row-wrap:hover button.object-tree__drag-handle,
  .object-tree__row-wrap:focus-within button.object-tree__drag-handle,
  .object-tree__row-wrap:has(.object-tree__row-actions--popover-open) button.object-tree__drag-handle {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .object-tree__row-wrap:has(.object-tree__row-actions--popover-open) button.object-tree__drag-handle {
    pointer-events: none;
  }
}

button.object-tree__drag-handle:focus-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

button.object-tree__drag-handle:hover:not(:disabled) {
  color: var(--c-text);
  background: var(--c-surface-hover, rgba(0, 0, 0, 0.04));
}

button.object-tree__drag-handle:active:not(:disabled) {
  cursor: grabbing;
}

button.object-tree__drag-handle--dragging {
  cursor: grabbing;
}

/* PATCH reorder in flight: ????????? ???? ??? not-allowed ? ??? dimmed disabled. */
button.object-tree__drag-handle--busy {
  pointer-events: none;
  cursor: grab;
}

body.object-tree-dnd-active,
body.object-tree-dnd-active * {
  cursor: grabbing !important;
}

/* ???????? drag ????? ? ?????? ?????? DragOverlay (????????? ??? droppable-???????). */
.object-tree__row-wrap.object-tree__row--dragging {
  opacity: 0;
}

.object-tree__folder-drop-wrap {
  min-width: 0;
}

.object-tree__folder-drop-wrap--method-target > .object-tree__row-wrap {
  border-radius: var(--radius-sm, 4px);
  background: color-mix(in srgb, var(--c-primary, #2563eb) 10%, var(--c-surface, #fff));
  outline: 1px solid color-mix(in srgb, var(--c-primary, #2563eb) 28%, transparent);
  outline-offset: -1px;
}

.object-tree__folder-drop-wrap--method-target > .object-tree__row-wrap .object-tree__row,
.object-tree__folder-drop-wrap--method-target > .object-tree__row-wrap .object-tree__toggle {
  background: transparent;
}

.object-tree-dnd-overlay {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  box-sizing: border-box;
  width: max-content;
  max-width: min(100vw - 2rem, 20rem);
  padding: 0.3rem 0.55rem 0.3rem 0.25rem;
  border: 1px solid var(--c-border, #e4e4e7);
  border-radius: var(--radius-sm, 4px);
  background: var(--c-surface, #fff);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
  color: var(--c-text);
  pointer-events: none;
  cursor: grabbing;
}

.object-tree-dnd-overlay__handle {
  flex-shrink: 0;
  color: var(--c-text-muted);
}

.object-tree-dnd-overlay__icon {
  flex-shrink: 0;
  display: inline-flex;
  color: var(--c-text-2);
}

.object-tree-dnd-overlay__label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (hover: none) {
  button.object-tree__drag-handle {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

.object-tree__row-wrap:hover .object-tree__actions,
.object-tree__row-wrap:focus-within .object-tree__actions,
.object-tree__actions:has(.object-tree__row-actions--popover-open) {
  pointer-events: auto;
}

.object-tree__row-wrap:hover .object-tree__action-btn,
.object-tree__row-wrap:focus-within .object-tree__action-btn,
.object-tree__actions:has(.object-tree__row-actions--popover-open) .object-tree__action-btn {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.constructor-v2-api-row-menu__separator {
  height: 1px;
  margin: 0.25rem 0.35rem;
  background: var(--c-border);
}

@media (hover: none) {
  .object-tree__actions {
    pointer-events: auto;
  }

  .object-tree__action-btn {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

.object-tree__row-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.1rem;
  flex-shrink: 0;
  width: 22px;
  min-width: 22px;
}

button.object-tree__action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm, 6px);
  background: transparent;
  color: var(--c-text-2);
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.1s ease, visibility 0.1s ease, background 0.1s ease, color 0.1s ease;
}

button.object-tree__action-btn:hover:not(:disabled) {
  background: var(--c-surface-2, #f4f4f5);
  color: var(--c-text);
}

button.object-tree__action-btn:focus-visible {
  outline: 2px solid var(--c-focus, #2563eb);
  outline-offset: 0;
}

button.object-tree__action-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

button.object-tree__action-btn--danger {
  color: var(--c-danger, #dc2626);
}

button.object-tree__action-btn--danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--c-danger, #dc2626) 10%, var(--c-surface-2, #f4f4f5));
  color: var(--c-danger, #dc2626);
}

/* always visible (not opacity:0) ? used in trash rows outside hover zone */
button.object-tree__action-btn--always-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.object-tree__row-menu {
  right: 0;
  left: auto;
  min-width: 9.5rem;
}

.object-tree__floating-popover {
  box-sizing: border-box;
}

/* ????????? ????????????? ???????? ObjectTree (portal, ?? ?????????? ??????? ???????) */
.object-tree__action-confirm {
  width: min(20rem, calc(100vw - 1rem));
  min-width: 17.5rem;
  max-width: 21.25rem;
  padding: 0.75rem 0.85rem;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 6px);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12), 0 2px 6px rgb(0 0 0 / 0.06);
}

.object-tree__action-confirm-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  min-width: 0;
}

.object-tree__action-confirm-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--c-text);
}

.object-tree__action-confirm-body,
.object-tree__action-confirm-note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--c-text-2);
  word-break: break-word;
}

.object-tree__action-confirm-note {
  font-size: 0.75rem;
  color: var(--c-text-3, #71717a);
}

.object-tree__action-confirm-error {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--c-danger, #dc2626);
}

.object-tree__action-confirm-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: nowrap;
  margin-top: 0.15rem;
}

.object-tree__move-picker > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  width: 100%;
}

.object-tree__move-picker {
  min-width: 11rem;
  max-width: min(16rem, calc(100vw - 1.5rem));
  padding: 0.4rem 0.5rem;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.09), 0 1px 3px rgba(0, 0, 0, 0.06);
  gap: 0.25rem;
}

.object-tree__delete-confirm-error {
  display: block;
  width: 100%;
  font-size: 0.75rem;
  color: var(--c-danger, #dc2626);
  line-height: 1.35;
}

.object-tree__floating-popover.constructor-table-more__menu {
  position: fixed;
  top: auto;
  right: auto;
  min-width: 9.5rem;
}

.object-tree__move-picker-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--c-text-2);
  line-height: 1.3;
}

.object-tree__move-picker-error {
  font-size: 0.7rem;
  color: var(--c-danger, #dc2626);
  line-height: 1.35;
}

.object-tree__move-picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 10rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.object-tree__move-picker-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--c-text);
  padding: 0.28rem 0.35rem;
  border-radius: 0.25rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.object-tree__move-picker-item:hover:not(:disabled) {
  background: var(--c-surface-2, rgba(0, 0, 0, 0.04));
}

.object-tree__move-picker-item:disabled {
  opacity: 0.5;
  cursor: default;
}

.object-tree__move-picker-item-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.object-tree__move-picker-current {
  color: var(--c-text-2);
  font-weight: 400;
}

.object-tree__move-picker-cancel {
  align-self: flex-start;
  margin-top: 0.1rem;
}

.object-tree__node--inline-edit {
  min-width: 0;
}

.object-tree__row--inline-edit,
.object-tree__row--inline-create {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.28rem 0.35rem;
}

.object-tree__inline-edit-input,
.object-tree__inline-create-input {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 0.2rem 0.35rem;
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: var(--c-text);
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border-strong, #d1d5db);
  border-radius: var(--radius-sm, 6px);
}

.object-tree__inline-edit-input:focus-visible,
.object-tree__inline-create-input:focus-visible {
  outline: 2px solid var(--c-focus, #2563eb);
  outline-offset: 0;
}

.object-tree__inline-edit-input:disabled,
.object-tree__inline-create-input:disabled {
  opacity: 0.7;
}

.object-tree__inline-edit-actions {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

button.object-tree__inline-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm, 6px);
  background: transparent;
  color: var(--c-text-2);
  cursor: pointer;
}

button.object-tree__inline-edit-btn:hover:not(:disabled) {
  background: var(--c-surface-2, #f4f4f5);
  color: var(--c-text);
}

button.object-tree__inline-edit-btn--confirm:not(:disabled) {
  color: var(--c-primary, #2563eb);
}

button.object-tree__inline-edit-btn:focus-visible {
  outline: 2px solid var(--c-focus, #2563eb);
  outline-offset: 0;
}

button.object-tree__inline-edit-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.object-tree__inline-edit-status,
.object-tree__inline-create-status {
  flex-shrink: 0;
  font-size: 0.75rem;
}

.object-tree__inline-edit-error,
.object-tree__inline-create-error {
  margin: 0.15rem 0.35rem 0.25rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--c-danger, #dc2626);
}

.object-tree__empty {
  margin: 0;
  padding: 1.25rem 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
  text-align: center;
  color: var(--c-text-2);
  max-width: 28rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.object-tree__empty-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-2);
  line-height: 1.45;
}

.object-tree__empty-desc {
  display: block;
  font-size: 0.8125rem;
  color: var(--c-text-3, #a1a1aa);
  line-height: 1.45;
}

.object-tree__folder-empty {
  display: block;
  padding: 0.25rem 0.5rem 0.25rem 1.75rem;
  font-size: 0.75rem;
  line-height: 1.4;
}

.object-tree__node--folder-empty {
  list-style: none;
}

.constructor-v2__object-tree-slot {
  margin-top: 0.5rem;
  min-width: 0;
  max-width: 38rem;
}

/* ??? API Sources two-column layout ??????????????????????????????????????? */
/* Height ownership: docs/architecture/api-sources-v2-layout.md
   Scope: ?????? constructor-v2 / panel Sources ? app-shell ? shell-layout ?? ???????. */

.constructor-v2:has(.constructor-v2__api-layout) {
  gap: 0.5rem;
}

.constructor-v2__panel:has(.constructor-v2__api-layout) {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* Height owner: ????????????? ??????? ?????? ?? viewport ????? chrome ??? panel (?? app-shell) */
.constructor-v2__api-layout {
  --constructor-v2-api-work-offset: calc(
    56px + 3rem + 5.0625rem + 1.5rem
  ); /* nav + body padding + toolbar band + body padding-bottom */
  display: flex;
  flex-direction: row-reverse;
  align-items: stretch;
  gap: 0;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  min-height: 12rem;
  height: calc(100vh - var(--constructor-v2-api-work-offset));
  max-height: calc(100vh - var(--constructor-v2-api-work-offset));
  box-sizing: border-box;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 6px);
  background: var(--c-surface, #fff);
  overflow: hidden;
}

.constructor-v2__api-tree-col {
  flex: 0 0 clamp(240px, 32%, 320px);
  width: clamp(240px, 32%, 320px);
  max-width: 320px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: var(--c-surface, #fff);
  box-sizing: border-box;
}

.constructor-v2__api-tree-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  flex: 1 1 auto;
  min-width: 0;
}

.constructor-v2__api-tree-order-hint {
  margin: 0.3rem 0.25rem 0.35rem;
  font-size: 0.6875rem;
  line-height: 1.35;
}

.constructor-v2__api-tree-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
  min-width: 0;
}

.constructor-v2__api-tree-section {
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 0;
  box-shadow: none;
}

.constructor-v2__api-tree-section + .constructor-v2__api-tree-section {
  margin-top: 0.5rem;
}

/* ?????? ????: toolbar + ????????? ?????? (+ ?????? ??? ?????????) */
.constructor-v2__api-tree-section-cap {
  margin: 0 0.4rem;
  min-width: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 6px);
  background: var(--c-surface, #fff);
  box-sizing: border-box;
  overflow: hidden;
}

.constructor-v2__api-tree-section-summary {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  min-height: 2rem;
  background: var(--c-surface-2, #f4f4f5);
  box-sizing: border-box;
}

.constructor-v2__api-tree-section-cap--expanded .constructor-v2__api-tree-section-summary {
  border-bottom: 1px solid var(--c-border);
}

.constructor-v2__api-tree-section-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 1.75rem;
  margin: 0;
  padding: 0.15rem 0.3rem 0.15rem 0.1rem;
  position: relative;
  z-index: 3;
  background: transparent;
  border: none;
  border-radius: 0;
  box-sizing: border-box;
}

.constructor-v2__api-tree-section-toolbar:has(.constructor-v2__api-tree-bulk-bar) {
  flex: 1 1 auto;
}

.constructor-v2__api-tree-section-toolbar .constructor-v2__api-tree-toolbar,
.constructor-v2__api-tree-section-toolbar .constructor-v2__api-trash-cleanup {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-width: 0;
}

.constructor-v2__api-tree-section-toolbar .constructor-v2__api-tree-toolbar > .constructor-v2__api-trash-cleanup {
  width: auto;
  flex: 0 0 auto;
}

.constructor-v2__api-tree-section-toolbar .constructor-v2__api-tree-header-actions,
.constructor-v2__api-tree-section-toolbar .constructor-v2__api-tree-bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}

.constructor-v2__api-tree-section-toolbar .constructor-v2__api-tree-bulk-bar {
  width: 100%;
  justify-content: flex-end;
}

/* ?????? ?????? ?????? ? ??? ??????????? ?????, hover ?? ???? ?????? */
.constructor-v2__api-tree-section-toolbar button.constructor-v2__api-icon-btn {
  border-color: transparent;
  background: transparent;
}

.constructor-v2__api-tree-section-toolbar button.constructor-v2__api-icon-btn:hover:not(:disabled) {
  background: var(--c-surface, #fff);
  border-color: var(--c-border);
  color: var(--c-text);
}

.constructor-v2__api-tree-section-toolbar button.constructor-v2__api-icon-btn--danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--c-danger) 8%, var(--c-surface, #fff));
  border-color: color-mix(in srgb, var(--c-danger) 28%, var(--c-border));
  color: var(--c-danger);
}


.constructor-v2__api-tree-section-head.object-tree__row-wrap {
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0 0.1rem 0 0.15rem;
  min-width: 0;
}

.constructor-v2__api-tree-section-head .object-tree__toggle {
  min-width: 0;
}

.constructor-v2__api-tree-section-body {
  min-width: 0;
  padding: 0.1rem 0 0.15rem;
  background: var(--c-surface, #fff);
}

.constructor-v2__api-trash-tree {
  --object-tree-actions-col: 3rem;
  min-width: 0;
  padding: 0 0.35rem 0.1rem;
}

.constructor-v2__api-trash-tree.object-tree--empty {
  border: none;
  box-shadow: none;
  background: transparent;
  min-height: 0;
  padding: 0.25rem 0;
}

.constructor-v2__api-trash-tree .object-tree__row-wrap .object-tree__actions,
.constructor-v2__api-trash-tree .object-tree__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.1rem;
  width: auto;
  min-width: var(--object-tree-actions-col);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.constructor-v2__api-trash-node-delete-anchor {
  display: inline-flex;
  align-items: center;
}

.constructor-v2__api-trash-node-delete-anchor--confirm-open {
  position: relative;
  z-index: 2;
}

.constructor-v2__api-tree-title {
  flex: 0 1 auto;
  min-width: 4.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* API Sources V2 left panel ? unified compact icon buttons */
button.constructor-v2__api-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  padding: 0;
  flex-shrink: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  box-shadow: none;
  min-height: 0;
  min-width: 0;
  color: var(--c-text-2);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

button.constructor-v2__api-icon-btn:hover:not(:disabled) {
  background: var(--c-bg);
  border-color: var(--c-border-strong);
  color: var(--c-text);
}

button.constructor-v2__api-icon-btn:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 1px;
}

button.constructor-v2__api-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

button.constructor-v2__api-icon-btn--danger {
  color: var(--c-danger);
  border-color: color-mix(in srgb, var(--c-danger) 28%, var(--c-border));
}

button.constructor-v2__api-icon-btn--danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--c-danger) 8%, var(--c-surface));
  border-color: color-mix(in srgb, var(--c-danger) 40%, var(--c-border));
  color: var(--c-danger);
}

/* Row variant: borderless, matches ObjectTree row action density */
button.constructor-v2__api-icon-btn--row {
  width: 1.375rem;
  height: 1.375rem;
  border-color: transparent;
  background: transparent;
  border-radius: var(--radius-sm, 6px);
}

button.constructor-v2__api-icon-btn--row:hover:not(:disabled) {
  background: var(--c-surface-2, #f4f4f5);
  border-color: transparent;
  color: var(--c-text);
}

button.constructor-v2__api-icon-btn--row.constructor-v2__api-icon-btn--danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--c-danger) 10%, var(--c-surface-2, #f4f4f5));
  color: var(--c-danger);
}

.constructor-v2__api-tree-bulk-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

.constructor-v2__api-tree-bulk-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--c-text-2);
  white-space: nowrap;
}

.constructor-v2__api-tree-bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}


.constructor-v2__api-tree-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 0.35rem 0 0.45rem;
  box-sizing: border-box;
}

.constructor-v2__api-tree-body {
  min-width: 0;
  padding: 0.15rem 0.35rem 0;
}

/* ??? ??????? API-?????? ??????????????????????????????????????????????????? */

.constructor-v2__api-trash {
  border-top: 1px solid var(--c-border);
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.constructor-v2__api-trash-summary {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.35rem 0.3rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-text-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
  justify-content: space-between;
}

.constructor-v2__api-trash-summary::-webkit-details-marker {
  display: none;
}

.constructor-v2__api-trash-summary:hover {
  color: var(--c-text);
}

/* Caret chevron: rotates when <details> is open */
.constructor-v2__api-trash-caret {
  flex-shrink: 0;
  color: var(--c-text-3);
  transition: transform 0.15s ease;
}

.constructor-v2__api-trash[open] .constructor-v2__api-trash-caret {
  transform: rotate(90deg);
}

.constructor-v2__api-trash-summary:hover .constructor-v2__api-trash-caret {
  color: var(--c-text-2);
}

/* Left group: icon + label + count */
.constructor-v2__api-trash-summary-left {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.constructor-v2__api-trash-icon {
  flex-shrink: 0;
  opacity: 0.7;
}

.constructor-v2__api-trash-count {
  font-size: 0.675rem;
  font-weight: 500;
  background: var(--c-surface-2, #f4f4f5);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 0 0.3rem;
  line-height: 1.5;
}

.constructor-v2__api-trash-label {
  min-width: 0;
}

/* Right group: action buttons inside summary */
.constructor-v2__api-trash-summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
}

.constructor-v2__api-trash-cleanup {
  display: inline-flex;
  align-items: center;
}

/* ?????????? ?????? ????????????? API Sources V2 */
.constructor-v2-api-confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.constructor-v2-api-confirm-dialog--top {
  align-items: flex-start;
  padding-top: 1.25rem;
}

.constructor-v2-api-confirm-dialog__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  cursor: default;
  background: color-mix(in srgb, var(--c-text) 38%, transparent);
  opacity: 1;
  box-shadow: none;
}

button.constructor-v2-api-confirm-dialog__backdrop {
  min-height: 0;
}

button.constructor-v2-api-confirm-dialog__backdrop:hover:not(:disabled),
button.constructor-v2-api-confirm-dialog__backdrop:focus,
button.constructor-v2-api-confirm-dialog__backdrop:focus-visible {
  background: color-mix(in srgb, var(--c-text) 38%, transparent);
  border: none;
  box-shadow: none;
  outline: none;
}

.constructor-v2-api-confirm-dialog__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  min-width: min(100%, 22.5rem);
  padding: 1rem 1.15rem 1.1rem;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--c-border);
  background: var(--c-surface, #fff);
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
}

.constructor-v2-api-confirm-dialog__title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--c-text);
}

.constructor-v2-api-confirm-dialog__body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--c-text-2);
}

.constructor-v2-api-confirm-dialog__error {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--c-danger, #dc2626);
}

.constructor-v2-api-confirm-dialog__skipped {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--c-text-2);
}

.constructor-v2-api-confirm-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.85rem;
}

.constructor-v2__api-trash-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.15rem 0.35rem 0.35rem;
}

.constructor-v2__api-trash-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.35rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.8125rem;
  line-height: 1.25;
  border-radius: var(--radius-sm, 6px);
  min-width: 0;
  transition: background 0.1s ease;
}

.constructor-v2__api-trash-row:hover {
  background: var(--c-surface-2, #f4f4f5);
}

.constructor-v2__api-trash-row-content {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.constructor-v2__api-trash-row-actions {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.1rem;
}

.constructor-v2__api-trash-row-actions--confirm-open {
  visibility: hidden;
  pointer-events: none;
}


.constructor-v2__api-trash-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  min-width: 16px;
  flex-shrink: 0;
  color: var(--c-text-3, #a1a1aa);
}

.constructor-v2__api-trash-row-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--c-text);
}

.constructor-v2__api-trash-row-date {
  flex-shrink: 0;
  font-size: 0.75rem;
  white-space: nowrap;
}


/* ??????????????????????????????????????????????????????????????????????????? */

.constructor-v2__api-details-col {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--c-surface, #fff);
}

.constructor-v2__api-details-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1.15rem 1.25rem;
  border: none;
  border-radius: 0;
  background: var(--c-surface, #fff);
  box-sizing: border-box;
}

.constructor-v2__api-details-title {
  margin: 0 0 0.3rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--c-text);
}

.constructor-v2__api-details-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.constructor-v2__api-tree-error {
  flex-shrink: 0;
  margin: 0;
  padding: 0.35rem 0.5rem 0.25rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--c-danger, #dc2626);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface, #fff);
}

.constructor-v2__api-details-col .source-method-v2-editor {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--c-surface, #fff);
}

.constructor-v2__api-details-col .source-method-v2-editor .constructor-home-source-catalog__drawer-inner {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 1.15rem 1rem;
  box-sizing: border-box;
}

.constructor-v2__api-details-col .source-method-v2-editor .constructor-home-source-catalog__drawer-header {
  flex: 0 0 auto;
  margin-top: 0;
  padding-top: 0.85rem;
}

.constructor-v2__api-details-col .source-method-v2-editor .constructor-home-source-catalog__drawer-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  overflow: hidden;
}

.constructor-v2__api-details-col .source-method-v2-editor .constructor-home-source-catalog__drawer-alerts {
  flex: 0 0 auto;
}

.constructor-v2__api-details-col .source-method-v2-editor .source-method-tabs {
  display: grid;
  /* 4 ???? ????? ??????????? �??????� + �????� ? �?????? ? ????� (Stage 3 UI S1). */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  flex: 0 0 auto;
  flex-shrink: 0;
  overflow-x: hidden;
  padding: 4px;
  gap: 0.2rem;
}

.constructor-v2__api-details-col .source-method-v2-editor .source-method-tabs__tab {
  flex: none;
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 0.35rem;
  font-size: 0.84375rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.constructor-v2__api-details-col .source-method-v2-editor .source-method-tabs__content {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--c-border) 70%, transparent) transparent;
}

.constructor-v2__api-details-col .source-method-v2-editor .source-method-tabs__content::-webkit-scrollbar {
  width: 8px;
}

.constructor-v2__api-details-col .source-method-v2-editor .source-method-tabs__content::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--c-border) 75%, var(--c-text-3, #94a3b8) 25%);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.source-method-v2-editor__title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--c-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ????????? ????????????? ????????? ? RunHeader (Stage 3 UI S3). */
.source-method-v2-editor__dirty {
  flex: 0 0 auto;
  font-size: 0.75rem;
  line-height: 1.2;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  color: var(--c-warning, #b45309);
  background: color-mix(in srgb, var(--c-warning, #b45309) 12%, transparent);
  white-space: nowrap;
}

.source-method-v2-editor__save-run-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.source-method-v2-editor__hint {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.source-method-v2-editor__meta-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  font-size: 0.875rem;
}

.source-method-v2-editor__meta-list--profile {
  margin-top: 0.35rem;
}

.source-method-v2-editor__meta-list-row,
.source-method-v2-editor__meta-list > div {
  display: grid;
  gap: 0.25rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 4px);
  background: var(--c-surface-2, #f8fafc);
}

.source-method-v2-editor__profile-stale-note {
  margin: 0;
  padding: 0.45rem 0.55rem;
  font-size: 0.8125rem;
  color: var(--c-text-2, var(--c-muted));
  border: 1px dashed var(--c-border);
  border-radius: var(--radius-sm, 4px);
  background: var(--c-surface, #fff);
}

.source-method-v2-editor__request-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.65rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 4px);
  background: var(--c-surface-2, #f8fafc);
}

.source-method-v2-editor__request-preview-text {
  flex: 1 1 auto;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.8125rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--c-text);
}

.source-method-v2-editor__request-preview .source-method-v2-editor__profile-stale-note {
  flex: 1 1 100%;
  margin: 0.15rem 0 0;
}

.source-method-v2-editor__request-block {
  margin-bottom: 0.65rem;
}

.source-method-v2-editor__request-method-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.source-method-v2-editor__request-method-row .source-method-v2-editor__http-method-field {
  flex: 0 0 7.5rem;
  min-width: 0;
  max-width: none;
  margin-bottom: 0;
}

.source-method-v2-editor__request-method-row .source-method-v2-editor__endpoint-field {
  flex: 0 0 auto;
  width: min(440px, 100%);
  max-width: min(440px, 100%);
  margin-bottom: 0;
}

.source-method-v2-editor__request-method-row .source-method-v2-editor__endpoint-field > input,
.source-method-v2-editor__request-method-row .source-method-v2-editor__endpoint-field > p {
  width: 100%;
  box-sizing: border-box;
}

.source-method-v2-editor__request-payload-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 0.65rem;
}

.source-method-v2-editor__request-payload-split .source-method-v2-editor__body-field,
.source-method-v2-editor__request-payload-split .source-method-v2-editor__query-field {
  max-width: none;
  margin-bottom: 0;
}

.source-method-v2-editor__request-payload-split textarea {
  min-height: 15rem;
  resize: vertical;
}

.source-method-v2-editor__domain-readout {
  margin: 0;
  font-size: 0.875rem;
}

.source-method-v2-editor__domain-readout-label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-3, var(--c-muted));
}

.constructor-home-source-catalog__field-input-row > .source-method-api-domain-picker {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: none;
}

/* API-?????: picker 440px ??? select, ?????? ?????????? ?????? ??????? */
.source-method-v2-editor__domain-field {
  max-width: none;
}

.source-method-v2-editor__domain-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: 100%;
}

.source-method-v2-editor__domain-row-main {
  flex: 1 1 auto;
  min-width: min(100%, 17.5rem);
}

.source-method-v2-editor__domain-limits {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  flex: 0 0 auto;
  margin-left: 1.5rem;
}

.source-method-v2-editor__domain-limit-field {
  width: 6.25rem;
  max-width: none;
  margin-bottom: 0;
}

.source-method-v2-editor__domain-limit-field:last-child {
  width: 8.5rem;
}

.source-method-v2-editor__domain-limit-field > span {
  white-space: nowrap;
}

.source-method-v2-editor__domain-limit-field > .source-method-v2-editor__domain-limit-readout {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.875rem;
  padding: 0.45rem 0.75rem;
  margin: 0;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  background-color: var(--c-surface-2, #f8fafc);
  color: var(--c-text);
  line-height: 1.35;
  cursor: default;
}

.source-method-v2-editor__domain-limit-readout:focus {
  outline: none;
  border-color: var(--c-border-strong);
  box-shadow: none;
}

.source-method-v2-editor__domain-control-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}

.source-method-v2-editor__domain-control-wrap > .source-method-api-domain-picker,
.source-method-v2-editor__domain-control-wrap > .source-method-v2-editor__domain-placeholder {
  width: 440px;
  max-width: 100%;
  flex: 0 0 auto;
}

.source-method-v2-editor__domain-placeholder {
  display: flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  background: var(--c-surface-2, #f8fafc);
  font-size: 0.875rem;
  color: var(--c-text-2, var(--c-muted));
  box-sizing: border-box;
}

/* Compact searchable API domain picker (V2 Request tab) */
.source-method-api-domain-picker {
  display: block;
  min-width: 0;
}

.constructor-home-source-catalog__field .source-method-api-domain-picker__trigger {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.45rem 0.75rem;
  padding-right: 2.25rem;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  background-color: var(--c-surface);
  font: inherit;
  font-size: 0.875rem;
  color: var(--c-text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.constructor-home-source-catalog__field .source-method-api-domain-picker__trigger:hover:not(:disabled) {
  border-color: var(--c-border-strong);
}

.constructor-home-source-catalog__field .source-method-api-domain-picker__trigger:focus-visible {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgb(124 58 237 / 0.12);
}

.constructor-home-source-catalog__field .source-method-api-domain-picker__trigger:focus-visible .source-method-api-domain-picker__chevron {
  color: var(--c-primary);
}

.source-method-api-domain-picker__trigger:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.source-method-api-domain-picker__trigger--placeholder .source-method-api-domain-picker__value {
  color: var(--c-text-2, var(--c-muted));
}

.source-method-api-domain-picker__value {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-method-api-domain-picker__chevron {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  width: 0.8125rem;
  height: 0.8125rem;
  transform: translateY(-50%);
  flex: none;
  color: #6b7280;
  pointer-events: none;
}

.source-method-api-domain-picker__popover.object-tree__floating-popover {
  box-sizing: border-box;
  overflow: hidden;
  padding: 0;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12), 0 2px 6px rgb(0 0 0 / 0.06);
}

.source-method-api-domain-picker__panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: min(18rem, 50vh);
  overflow: hidden;
  box-sizing: border-box;
}

.source-method-api-domain-picker__search {
  flex: none;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.5rem 0.65rem;
  border: none;
  border-bottom: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 6px) var(--radius-sm, 6px) 0 0;
  background: var(--c-surface, #fff);
  font-size: 0.8125rem;
  color: var(--c-text);
}

.source-method-api-domain-picker__search:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--c-focus, #3b82f6);
}

.source-method-api-domain-picker__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.35rem 0;
}

.source-method-api-domain-picker__section + .source-method-api-domain-picker__section {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--c-border);
}

.source-method-api-domain-picker__section-label {
  margin: 0;
  padding: 0.15rem 0.65rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--c-text-3, #71717a);
}

.source-method-api-domain-picker__options {
  margin: 0;
  padding: 0;
  list-style: none;
}

button.source-method-api-domain-picker__option {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 0;
  padding: 0.35rem 0.65rem;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: inherit;
  line-height: 1.35;
  letter-spacing: inherit;
  color: var(--c-text);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

button.source-method-api-domain-picker__option:hover:not(:disabled) {
  background: var(--c-surface-2, #f8fafc);
  border: none;
  box-shadow: none;
}

button.source-method-api-domain-picker__option--selected {
  font-weight: 500;
}

.source-method-api-domain-picker__option-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-method-api-domain-picker__check {
  flex: none;
  color: var(--c-primary, #2563eb);
}

.source-method-api-domain-picker__empty {
  margin: 0;
  padding: 0.65rem;
  font-size: 0.8125rem;
  text-align: center;
}

.source-method-v2-editor__domain-manage-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
}

/* API domains manager modal (V2 Request tab) ? compact form column + tree */
.api-domains-modal {
  --api-domains-form-col-width: 28rem;
  --api-domains-notice-min-height: 5.85rem;
  --api-domains-tree-inset-x: 0.35rem;
  --api-domains-card-height: 40.5rem;
  --api-domains-card-max-vh: 92vh;
}

.api-domains-modal__card {
  width: min(92vw, 50rem);
  max-width: 50rem;
  height: min(var(--api-domains-card-max-vh), var(--api-domains-card-height));
  min-height: min(var(--api-domains-card-max-vh), var(--api-domains-card-height));
  max-height: min(var(--api-domains-card-max-vh), var(--api-domains-card-height));
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1rem 1rem;
  box-sizing: border-box;
}

.api-domains-modal__layout {
  display: grid;
  grid-template-columns: var(--api-domains-form-col-width) minmax(0, 1fr);
  gap: 0.85rem;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  align-items: stretch;
  overflow: hidden;
}

.api-domains-modal__left-panel {
  min-width: 0;
  max-width: var(--api-domains-form-col-width);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: transparent;
  box-sizing: border-box;
}

.api-domains-modal__notice-strip {
  flex-shrink: 0;
  margin-top: 0.35rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 4px);
  background: var(--c-surface-2, #f4f4f5);
  min-height: var(--api-domains-notice-min-height);
  box-sizing: border-box;
}

.api-domains-modal__notice-strip p {
  margin: 0;
}

.api-domains-modal__notice-strip p + p {
  margin-top: 0.35rem;
}

.api-domains-modal__notice-placeholder {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--c-text-3, var(--c-muted));
}

.api-domains-modal__left-scroll {
  flex: 0 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: none;
  background: transparent;
  box-sizing: border-box;
}

.api-domains-modal__tree-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  border: none;
  border-radius: 0;
  background: transparent;
}

.api-domains-modal__tree-panel .constructor-v2__api-tree-section-cap {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 6px);
  background: var(--c-surface, #fff);
  box-shadow: none;
  overflow: hidden;
  box-sizing: border-box;
}

.api-domains-modal__tree-panel .constructor-v2__api-tree-section-cap--expanded {
  flex: 1 1 auto;
  min-height: 0;
}

.api-domains-modal__tree-panel .constructor-v2__api-tree-section-cap--expanded .constructor-v2__api-tree-section-summary {
  border-bottom: 1px solid var(--c-border);
}

.api-domains-modal__tree-panel .constructor-v2__api-tree-section-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.api-domains-modal__tree-panel .constructor-v2__api-tree-section-cap,
.api-domains-modal__tree-panel .constructor-v2__api-tree-section-summary {
  background: var(--c-surface-2, #f4f4f5);
}

.api-domains-modal__tree-panel .constructor-v2__api-tree-section {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.api-domains-modal__tree-panel > .constructor-v2__api-tree-section:first-of-type:has(
    .constructor-v2__api-tree-section-cap--expanded
  ) {
  flex: 1.25 1 0;
  min-height: 8rem;
}

.api-domains-modal__tree-panel > .api-domains-modal__trash-section:has(
    .constructor-v2__api-tree-section-cap--expanded
  ) {
  flex: 0.75 1 0;
  min-height: 4.5rem;
  max-height: 45%;
}

.api-domains-modal__tree-panel .constructor-v2__api-tree-scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.35rem var(--api-domains-tree-inset-x) 0.45rem;
  box-sizing: border-box;
  background: var(--c-surface, #fff);
}

.api-domains-modal__tree-panel .constructor-v2__api-tree-body {
  padding: 0.15rem 0 0;
}

.api-domains-modal__tree-scroll {
  flex: 1 1 auto;
  min-height: 0;
}

.api-domains-modal__tree.object-tree {
  min-width: 0;
  --object-tree-actions-col: 3rem;
}

.api-domains-modal__tree .object-tree__row-actions--with-key-actions {
  width: auto;
  min-width: 22px;
  max-width: var(--object-tree-actions-col);
  gap: 0.1rem;
}

.api-domains-modal__tree .object-tree__row-wrap .object-tree__actions {
  overflow: visible;
  background: transparent;
}

.api-domains-modal__tree button.object-tree__row,
.api-domains-modal__tree button.object-tree__toggle {
  min-height: 1.625rem;
}

.api-domains-modal__tree .object-tree__row-actions--with-key-actions button.object-tree__action-btn:disabled {
  opacity: 0;
  visibility: hidden;
}

.api-domains-modal__tree .object-tree__row-wrap:hover .object-tree__row-actions--with-key-actions button.object-tree__action-btn:disabled,
.api-domains-modal__tree .object-tree__row-wrap:focus-within .object-tree__row-actions--with-key-actions button.object-tree__action-btn:disabled,
.api-domains-modal__tree .object-tree__actions:has(.object-tree__row-actions--popover-open) .object-tree__row-actions--with-key-actions button.object-tree__action-btn:disabled {
  opacity: 0.45;
  visibility: visible;
  pointer-events: none;
}

.api-domains-modal .clear-period-actions {
  flex-shrink: 0;
  margin-top: 0.65rem;
  padding-top: 0;
}

.api-domains-modal__footer {
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.api-domains-modal__footer-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  min-width: 0;
}

.api-domains-modal__list-panel {
  min-width: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 4px);
  background: var(--c-surface-2, #f8fafc);
  padding: 0.45rem;
  overflow-y: auto;
  max-height: 22rem;
}

.api-domains-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.api-domains-modal__row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm, 4px);
  font-family: inherit;
}

.api-domains-modal__row:hover {
  background: color-mix(in srgb, var(--c-surface) 88%, var(--c-border) 12%);
}

.api-domains-modal__row--selected {
  background: var(--c-surface);
  box-shadow: inset 0 0 0 1px var(--c-border);
}

.api-domains-modal__row-host {
  font-size: 0.75rem;
  color: var(--c-text-3, var(--c-muted));
}

.api-domains-modal__list-status {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.8125rem;
}

.api-domains-modal__details-panel {
  min-width: 0;
  width: 100%;
  max-width: var(--api-domains-form-col-width);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 0 0 auto;
  align-items: stretch;
}

.api-domains-modal__details {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 4px);
  background: var(--c-surface-2, #f8fafc);
}

.api-domains-modal__details-title,
.api-domains-modal__form-title {
  margin: 0 0 0.45rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-text);
}

.api-domains-modal__meta {
  margin: 0;
  font-size: 0.8125rem;
}

.api-domains-modal__meta dt {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--c-text-3, var(--c-muted));
  text-transform: uppercase;
}

.api-domains-modal__meta dd {
  margin: 0 0 0.35rem;
}

.api-domains-modal__domain-form {
  flex: 0 0 auto;
  width: 100%;
  max-width: var(--api-domains-form-col-width);
  box-sizing: border-box;
  border: none;
  border-radius: 0;
  padding: 0.55rem 0.65rem;
  background: transparent;
}

.api-domains-modal__domain-form .constructor-folder-modal__form {
  width: 100%;
  max-width: calc(var(--api-domains-form-col-width) - 1.3rem);
  box-sizing: border-box;
  min-height: calc(20.5rem + var(--api-domains-notice-min-height));
}

.api-domains-modal__domain-form .constructor-folder-modal__field input,
.api-domains-modal__domain-form .constructor-folder-modal__select {
  width: 100%;
  box-sizing: border-box;
}

.api-domains-modal__field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
  min-width: 0;
}

.api-domains-modal__field-readonly,
.api-domains-modal__domain-form .constructor-folder-modal__field input.api-domains-modal__field-readonly,
.api-domains-modal__domain-form .constructor-folder-modal__select.api-domains-modal__field-readonly {
  background: var(--c-surface-2, #f4f4f5);
  color: var(--c-text);
  cursor: default;
  opacity: 1;
}

.api-domains-modal__domain-form .constructor-folder-modal__field input.api-domains-modal__invalid-value {
  color: var(--c-danger, #b91c1c);
  border-color: color-mix(in srgb, var(--c-danger) 35%, var(--c-border));
}

.api-domains-modal__service-rows {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.1rem;
  min-width: 0;
}

.api-domains-modal__service-row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  column-gap: 0.45rem;
  align-items: start;
  min-width: 0;
  font-size: 0.75rem;
  line-height: 1.35;
}

.api-domains-modal__service-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--c-text-3, var(--c-muted));
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.api-domains-modal__service-value {
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.api-domains-modal__service-value--muted {
  color: var(--c-text-3, var(--c-muted));
}

.api-domains-modal__service-code {
  font-size: 0.6875rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.api-domains-modal__limits-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  min-width: 0;
}

.api-domains-modal__limits-field {
  min-width: 0;
}

.api-domains-modal__limits-field-hint {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  line-height: 1.3;
}

.api-domains-modal__limits-field-hint--error {
  color: var(--c-danger, #b91c1c);
}

.api-domains-modal__limits-field-hint--warn {
  color: color-mix(in srgb, var(--c-warning, #b45309) 85%, var(--c-text));
}

.api-domains-modal__validate-info {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--c-text-muted);
}

.api-domains-modal__field-warning {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--c-danger, #b91c1c);
}

.api-domains-modal__invalid-value {
  color: var(--c-danger, #b91c1c);
}

.api-domains-modal__invalid-value code {
  color: inherit;
}

.api-domains-modal__trash-section .constructor-v2__api-trash-tree.object-tree--empty {
  border: none;
  box-shadow: none;
}

.source-method-v2-editor__meta-list dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-3, var(--c-muted));
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.source-method-v2-editor__meta-list dd {
  margin: 0;
  color: var(--c-text);
  word-break: break-word;
}

.source-method-v2-editor__kv-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.875rem;
}

.source-method-v2-editor__pre {
  margin: 0;
  padding: 0.5rem 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--c-surface-2, #f8fafc);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 4px);
}

.source-method-v2-test-panel__banner {
  margin-bottom: 0.75rem;
}

.source-method-v2-test-panel__notice {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 4px);
  background: var(--c-surface-2, #f8fafc);
}

.source-method-v2-test-panel__notice p {
  margin: 0;
}

.source-method-v2-test-panel__notice--warn {
  border-color: color-mix(in srgb, var(--c-warning, #d97706) 35%, var(--c-border));
  background: color-mix(in srgb, var(--c-warning, #d97706) 8%, var(--c-surface, #fff));
}

.source-method-v2-test-panel__notice--error {
  border-color: color-mix(in srgb, var(--c-danger, #dc2626) 35%, var(--c-border));
  background: color-mix(in srgb, var(--c-danger, #dc2626) 8%, var(--c-surface, #fff));
}

.source-method-v2-test-panel__alert-list {
  list-style: none;
  margin: 0 0 0.65rem;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.source-method-v2-test-panel__readiness-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.source-method-v2-test-panel__readiness-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 0.55rem;
  align-items: start;
  padding: 0.5rem 0.6rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 4px);
  background: var(--c-surface, #fff);
}

.source-method-v2-test-panel__readiness-item.readiness--ok {
  border-color: color-mix(in srgb, var(--c-success, #15803d) 30%, var(--c-border));
}

.source-method-v2-test-panel__readiness-item.readiness--warn {
  border-color: color-mix(in srgb, var(--c-warning, #d97706) 35%, var(--c-border));
  background: color-mix(in srgb, var(--c-warning, #d97706) 6%, var(--c-surface, #fff));
}

.source-method-v2-test-panel__readiness-item.readiness--fail {
  border-color: color-mix(in srgb, var(--c-danger, #dc2626) 35%, var(--c-border));
  background: color-mix(in srgb, var(--c-danger, #dc2626) 6%, var(--c-surface, #fff));
}

.source-method-v2-test-panel__readiness-item.readiness--neutral {
  color: var(--c-text-2, var(--c-muted));
}

.source-method-v2-test-panel__readiness-mark {
  font-weight: 700;
  line-height: 1.45;
}

.source-method-v2-test-panel__readiness-text {
  min-width: 0;
  word-break: break-word;
}

/* Phase F-1: Extraction diagnostics section */
.source-method-v2-test-panel__extraction-diag {
  margin-top: 0.75rem;
}

.source-method-v2-test-panel__extraction-diag-hint {
  margin-top: 0.15rem;
  margin-bottom: 0.5rem;
}

.source-method-v2-test-panel__extraction-diag-path {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
}

.source-method-v2-test-panel__extraction-diag-fields {
  margin-top: 0.5rem;
}

.source-method-v2-test-panel__extraction-diag-fields-header {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
}

.source-method-v2-test-panel__extraction-diag-fields-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
}

.source-method-v2-test-panel__extraction-diag-field {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
}

.source-method-v2-test-panel__extraction-diag-field-type {
  font-size: 0.75rem;
}

.source-method-v2-test-panel__runtime-title {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.source-method-v2-test-panel__runtime-inputs {
  margin-bottom: 0.75rem;
}

.source-method-v2-test-panel__actions {
  margin: 0.75rem 0;
}

.source-method-v2-test-panel__subheading {
  margin: 0 0 0.45rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-text-2, var(--c-muted));
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.source-method-v2-test-panel__last-run,
.source-method-v2-test-panel__history,
.source-method-v2-test-panel__raw-response {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--c-border);
}

.source-method-v2-test-panel__run-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
  font-size: 0.875rem;
}

.source-method-v2-test-panel__preview {
  margin-bottom: 0.65rem;
}

/* ??? ?????????? ???????: ?????????? ???? execution metadata ???????????????? */
.source-method-v2-test-panel__diag-wrap {
  margin-bottom: 0.65rem;
}

.source-method-v2-test-panel__diag {
  margin: 0;
  display: grid;
  gap: 0;
}

.source-method-v2-test-panel__diag > div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  column-gap: 0.5rem;
  align-items: baseline;
  padding: 0.25rem 0;
  border-top: 1px solid var(--c-border);
  font-size: 0.8125rem;
}

.source-method-v2-test-panel__diag > div:first-child {
  border-top: none;
}

.source-method-v2-test-panel__diag dt {
  margin: 0;
  color: var(--c-text-3, var(--c-muted));
  font-weight: 500;
}

.source-method-v2-test-panel__diag dd {
  margin: 0;
  color: var(--c-text);
  word-break: break-all;
  min-width: 0;
}

.source-method-v2-test-panel__diag-code {
  font-size: 0.8125rem;
  word-break: break-all;
}

/* ???????????? ?????? ?????? diag-wrap (????????, �Query-?????????� ????? request line). */
.source-method-v2-test-panel__subheading--section {
  margin-top: 0.75rem;
}

/* ??????-?????? ??????: �HTTP 200 � 45 KB � 1.2 ?� ? ????? �??? ????????�. */
.source-method-v2-test-panel__response-summary {
  margin: 0 0 0.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--c-text);
  line-height: 1.6;
}

.source-method-v2-test-panel__response-summary > span + span::before {
  content: '�';
  margin-right: 0.5rem;
  color: var(--c-text-3, var(--c-muted));
}

/* HTTP-?????? ? ?????? ?????? ? ??????????. */
.source-method-v2-test-panel__response-status {
  font-weight: 700;
}

/* ?????? ???????: �GET /api/v3/...� ? ????? �??? ??????????�. */
.source-method-v2-test-panel__request-line {
  margin: 0 0 0.25rem;
  padding: 0.3rem 0.5rem;
  background: var(--c-bg-2, var(--c-bg-muted, #f5f5f5));
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 0.8125rem;
  color: var(--c-text);
  word-break: break-all;
  line-height: 1.5;
}

/* HTTP-????? (GET/POST) ? ?????? ??????? ? ?????????? ????????? ????. */
.source-method-v2-test-panel__request-method {
  font-weight: 700;
  margin-right: 0.45rem;
  color: var(--c-accent, var(--c-primary, inherit));
}

/* ??????????????? JSON ???? ??????? ? ????? �??? ??????????�. */
.source-method-v2-test-panel__body-preview {
  margin: 0;
  padding: 0.4rem 0.5rem;
  background: var(--c-bg-2, var(--c-bg-muted, #f5f5f5));
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--c-text);
  white-space: pre;
  overflow-x: auto;
  max-height: 16rem;
  overflow-y: auto;
}

/* ???????? ???????? (masked) query-????????? ? ??????? **** ? ??????? ?????. */
.source-method-v2-test-panel__diag-masked {
  font-size: 0.8125rem;
  color: var(--c-text-3, var(--c-muted));
  letter-spacing: 0.05em;
}

.source-method-v2-test-panel__warnings {
  margin: 0 0 0.65rem;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  color: var(--c-text-2);
}

.source-method-v2-test-panel__warning {
  margin-bottom: 0.25rem;
}

.source-method-v2-test-panel__history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.source-method-v2-test-panel__history-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  text-align: left;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 4px);
  background: var(--c-surface, #fff);
  color: var(--c-text);
  cursor: pointer;
}

.source-method-v2-test-panel__history-item:hover {
  background: var(--c-surface-2, #f8fafc);
}

.source-method-v2-test-panel__history-item--active {
  border-color: var(--c-primary, #2563eb);
  background: var(--c-surface-2, #f8fafc);
}

/* Response viewer tabs (Raw / JSON / ?????????) */
.source-method-v2-test-panel__response-tabs {
  display: flex;
  gap: 0;
  flex-shrink: 0;
}

.source-method-v2-test-panel__response-tab {
  padding: 0.2rem 0.7rem;
  font-size: 0.8rem;
  line-height: 1.6;
  background: transparent;
  border: 1px solid var(--c-border);
  margin-right: -1px;
  cursor: pointer;
  color: var(--c-text-2, var(--c-muted));
  white-space: nowrap;
  position: relative;
  transition: background 0.1s, color 0.1s;
}

.source-method-v2-test-panel__response-tab:first-child {
  border-radius: var(--radius-sm, 4px) 0 0 var(--radius-sm, 4px);
}

.source-method-v2-test-panel__response-tab:last-child {
  border-radius: 0 var(--radius-sm, 4px) var(--radius-sm, 4px) 0;
  margin-right: 0;
}

.source-method-v2-test-panel__response-tab:only-child {
  border-radius: var(--radius-sm, 4px);
  margin-right: 0;
}

.source-method-v2-test-panel__response-tab--active {
  background: var(--c-primary, #2563eb);
  border-color: var(--c-primary, #2563eb);
  color: #fff;
  z-index: 1;
}

.source-method-v2-test-panel__response-tab:hover:not(.source-method-v2-test-panel__response-tab--active) {
  background: var(--c-surface-2, #f8fafc);
  color: var(--c-text-1, inherit);
}

.source-method-v2-test-panel__raw-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.source-method-v2-test-panel__raw-truncate-banner {
  margin: 0 0 0.5rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.8125rem;
  color: var(--c-text-2, var(--c-muted));
  background: var(--c-surface-2, #f8fafc);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 4px);
}

.source-method-v2-test-panel__raw-pre {
  margin: 0;
  max-height: 24rem;
  overflow: auto;
  padding: 0.65rem 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--c-surface-2, #f8fafc);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm, 4px);
}

.source-method-v2-test-panel__raw-copy--copied {
  color: var(--c-success, #15803d);
  border-color: var(--c-success, #15803d);
}

/* PREVIEW_INLINE artifact banner: banner text + open button side by side */
.source-method-v2-test-panel__artifact-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.source-method-v2-test-panel__artifact-banner .source-method-v2-test-panel__raw-truncate-banner {
  margin-bottom: 0;
  flex: 1;
}

/* Phase E-1: Artifact viewer modal */
.artifact-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.artifact-modal {
  background: var(--c-bg, #fff);
  border: 1px solid var(--c-border, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  width: 100%;
  max-width: 860px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.artifact-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--c-border, #e5e7eb);
  flex-shrink: 0;
}

.artifact-modal__title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
}

.artifact-modal__close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--c-text-muted, #6b7280);
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm, 4px);
  line-height: 1;
}
.artifact-modal__close:hover {
  background: var(--c-bg-hover, #f3f4f6);
}

.artifact-modal__body {
  padding: 0.9rem 1.1rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.artifact-modal__meta {
  margin-bottom: 0.5rem;
}

.artifact-modal__pre {
  flex: 1;
  margin: 0;
  max-height: 50vh;
}

@media (max-width: 720px) {
  .constructor-v2__api-layout {
    flex-direction: column-reverse;
    height: calc(100vh - var(--constructor-v2-api-work-offset));
    max-height: calc(100vh - var(--constructor-v2-api-work-offset));
  }

  .constructor-v2__api-tree-col {
    flex: 0 0 min(46vh, 28rem);
    width: 100%;
    max-width: 100%;
    height: min(46vh, 28rem);
    border-top: 1px solid var(--c-border);
  }

  .constructor-v2__api-details-col {
    flex: 1 1 0;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    height: auto;
  }
}


/* ??? Constructor V2 shell (????? ?????? /constructor) ????????????????????? */
.constructor-v2 {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.75rem;
}

section.constructor-v2__toolbar {
  margin: 0 0 0.75rem;
  padding: 0.85rem 1.25rem 0.95rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
}

.constructor-v2__toolbar-row {
  display: flex;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  min-width: 0;
}

.constructor-v2__toolbar-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
  flex-shrink: 0;
}

.constructor-v2__nav-slot {
  margin: 0;
  overflow: visible;
}

/* ??? SectionFlyoutNav (????? ??????? ?????????) ????????????????????????????? */
.section-flyout-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.35rem;
  overflow: visible;
}

.section-flyout-nav__group {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  vertical-align: top;
  min-width: 0;
}

.section-flyout-nav__measure {
  display: grid;
  grid-template-columns: max-content;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.section-flyout-nav__measure-trigger,
.section-flyout-nav__measure-row {
  grid-column: 1;
  grid-row: 1;
  width: max-content;
  max-width: none;
}

.section-flyout-nav__measure-trigger {
  display: inline-flex;
  align-items: center;
  width: 100%;
  gap: 0.35rem;
  padding-left: 0.65rem;
  padding-right: 0.5rem;
  box-sizing: border-box;
}

button.section-flyout-nav__trigger {
  display: inline-flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  justify-content: flex-start;
  gap: 0.35rem;
  padding-left: 0.65rem;
  padding-right: 0.5rem;
  margin: 0;
  cursor: pointer;
}

.section-flyout-nav__trigger-label {
  flex: 0 1 auto;
  white-space: nowrap;
}

.section-flyout-nav__chevron {
  flex-shrink: 0;
  margin-left: auto;
  opacity: 0.55;
  transition: transform 0.15s ease, opacity 0.12s ease;
}

.section-flyout-nav__group:hover .section-flyout-nav__chevron,
.section-flyout-nav__group:focus-within .section-flyout-nav__chevron,
.section-flyout-nav__group--menu-open .section-flyout-nav__chevron {
  opacity: 0.85;
  transform: rotate(180deg);
}

.section-flyout-nav__menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 50;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.3rem;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border, #e4e4e7);
  border-radius: var(--radius-sm, 6px);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 6px 16px -6px rgba(0, 0, 0, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-3px);
  transition:
    opacity 0.14s ease,
    transform 0.14s ease,
    visibility 0.14s ease;
}

.section-flyout-nav__group:hover .section-flyout-nav__menu,
.section-flyout-nav__group:focus-within .section-flyout-nav__menu,
.section-flyout-nav__group--menu-open .section-flyout-nav__menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.section-flyout-nav__menu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 8px;
}

button.section-flyout-nav__item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.55rem 0.45rem 0.5rem;
  font-size: 0.8125rem;
  font-family: inherit;
  font-weight: 400;
  line-height: 1.25;
  text-align: left;
  color: var(--c-text);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-sm, 6px) - 1px);
  cursor: pointer;
  box-shadow: none;
  transition: background 0.1s ease, color 0.1s ease;
}

button.section-flyout-nav__item:hover:not(:disabled) {
  background: var(--c-surface-2, #f4f4f5);
  color: var(--c-text);
}

button.section-flyout-nav__item--active {
  font-weight: 500;
  color: var(--c-primary, #2563eb);
  background: color-mix(in srgb, var(--c-primary, #2563eb) 8%, var(--c-surface, #fff));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-primary, #2563eb) 45%, transparent);
}

button.section-flyout-nav__item--active:hover:not(:disabled) {
  background: color-mix(in srgb, var(--c-primary, #2563eb) 12%, var(--c-surface, #fff));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-primary, #2563eb) 55%, transparent);
}

.section-flyout-nav__item-icon {
  flex-shrink: 0;
  display: inline-flex;
  margin-top: 0.05rem;
  color: var(--c-text-2);
  opacity: 0.88;
}

button.section-flyout-nav__item--active .section-flyout-nav__item-icon {
  color: var(--c-primary, #2563eb);
  opacity: 1;
}

.section-flyout-nav__item-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.section-flyout-nav__item-label {
  white-space: nowrap;
}

.section-flyout-nav__item-description {
  font-size: 0.75rem;
  line-height: 1.3;
  white-space: nowrap;
}

button.section-flyout-nav__item:focus-visible,
button.section-flyout-nav__trigger:focus-visible {
  outline: 2px solid var(--c-focus, #2563eb);
  outline-offset: 0;
}

.constructor-v2__panel {
  min-width: 0;
  margin: 0;
  padding: 1.15rem 1.25rem 1.35rem;
  background: var(--c-surface-2, #f9fafb);
  border: 1px solid var(--c-border, #e4e4e7);
  border-radius: var(--radius-md, 8px);
  box-sizing: border-box;
}

.constructor-v2__panel-content {
  margin: 0;
  max-width: 38rem;
}

.constructor-v2__panel-content-title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--c-text);
}

.constructor-v2__panel-content-text {
  margin: 0 0 0.45rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.constructor-v2__panel-content-note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.constructor-v2__tables-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.constructor-v2__tables-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ??? ConstructorEmptyState ???????????????????????????????????????????????? */
.constructor-empty-state {
  padding: 1.75rem 1rem;
  text-align: center;
}

.constructor-empty-state__message {
  font-size: 0.875rem;
  color: var(--c-text-2);
  margin: 0 0 0.65rem;
}

.constructor-empty-state--error .constructor-empty-state__message {
  color: var(--c-danger, #dc2626);
}

.constructor-empty-state__action {
  /* inherits .btn-secondary .btn-sm */
}

/* ??? Source catalog: normalize method title font-size to match tables ?????? */
.constructor-home-source-catalog .wizard-source-radio__title {
  font-size: 0.8125rem;
  max-width: min(18rem, 48vw);
}

/* ??? Table folders (Phase 2) ??????????????????????????????????????????????? */
.constructor-home__other-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.45rem 0.15rem;
}

.constructor-home__tree-summary--folder {
  gap: 0.35rem;
}

.constructor-home__folder-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* Tree-level icon action button: + ?????, ? folder menu trigger.
   Borderless / transparent ? same visual weight as row icon-link buttons. */
.constructor-home__tree-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  padding: 0;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  box-shadow: none;
  min-height: 0;
  min-width: 0;
  color: var(--c-text-3);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.constructor-home__tree-icon-btn:hover:not(:disabled) {
  background: var(--c-primary-bg);
  color: var(--c-text-2);
}

.constructor-home__tree-icon-btn:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.constructor-home__tree-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.constructor-home__tree-icon-btn--danger {
  color: var(--c-danger, #dc2626);
}

.constructor-home__tree-icon-btn--danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--c-danger, #dc2626) 10%, transparent);
  color: var(--c-danger, #dc2626);
}

/* Wrapper for the ? dropdown menu on folder headers */
.constructor-home__folder-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}

.constructor-home__folder-menu-wrap .constructor-home__folder-actions {
  margin-left: 0;
}

/* Folder dropdown inherits table-more menu styles but anchored to folder header */
.constructor-home__folder-dropdown {
  right: 0;
  left: auto;
  min-width: 11rem;
}

.constructor-home__table-row-line2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.12rem;
  font-size: 0.75rem;
}

.constructor-folder-modal__form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.constructor-folder-modal__field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8125rem;
}

.constructor-folder-modal__field input,
.constructor-folder-modal__select {
  padding: 0.35rem 0.55rem;
  font-size: 0.875rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg);
  color: var(--c-text);
  font-family: inherit;
}

.constructor-folder-modal__select {
  padding-right: 1.8rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 14px 14px;
}

.constructor-folder-modal__lede {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
}

.constructor-folder-modal__hint {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--c-text-2);
}

.constructor-folder-modal__error {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--c-danger);
}

.constructor-folder-modal__empty {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.55rem;
}

.constructor-folder-modal__empty-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text);
}

.constructor-folder-modal__create-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  background: none;
  border: none;
  font-size: 0.8125rem;
  color: var(--c-primary, var(--c-text-2));
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.constructor-folder-modal__create-link:hover {
  opacity: 0.8;
}

/* ??? Source catalog: section-level tree (replaces marketplace tabs) ??????? */
.constructor-home-source-catalog__sections > .constructor-home__tree-node + .constructor-home__tree-node {
  margin-top: 0.45rem;
}

/* Intro paragraph bottom margin (wizard-source-picker__lede has margin:0) */
.constructor-home-source-catalog__intro-lede {
  margin-bottom: 0.55rem;
}

/* Remove gray panel surface from catalog ? sources now sit on plain bg */
.constructor-home__panel .constructor-home-source-catalog {
  background: transparent;
}

/* ??? API group summary: align count badge ????????????????????????????????? */
.constructor-home-source-catalog__api-group-summary {
  display: flex;
  align-items: center;
  gap: 0;
}

/* ??? Trash section ??????????????????????????????????????????????????????? */
.constructor-home-source-catalog__trash-section {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
  padding-top: 0.75rem;
}

.constructor-home-source-catalog__trash-summary {
  color: var(--color-muted, #6b7280);
}

.constructor-home-source-catalog__trash-icon {
  flex-shrink: 0;
  margin-right: 0.3rem;
  opacity: 0.7;
}

.constructor-home-source-catalog__trash-hint {
  margin: 0.4rem 0 0.6rem;
  font-size: 0.8rem;
  padding: 0 0.1rem;
}

/* Trashed method row: muted appearance, no pointer cursor */
.constructor-home-source-catalog__trash-method {
  opacity: 0.8;
}

.constructor-home-source-catalog__trash-method .wizard-source-radio__surface {
  cursor: default;
  flex-direction: column;
  gap: 0.15rem;
}

.constructor-home-source-catalog__trash-method .wizard-source-radio__surface:hover {
  background: transparent;
}

.constructor-home-source-catalog__trash-meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.77rem;
  padding: 0 0 0.05rem 1.35rem;
  flex-wrap: wrap;
  color: var(--color-muted, #9ca3af);
}

.constructor-home-source-catalog__trash-sep {
  opacity: 0.5;
  user-select: none;
}

/* Danger item in ? menu */
.constructor-table-more__item--danger {
  color: var(--color-danger, #dc2626);
}

.constructor-table-more__item--danger:hover {
  background: var(--color-danger-bg, #fef2f2);
  color: var(--color-danger, #dc2626);
}

/* Restore button inline icon alignment */
.constructor-home-source-catalog__trash-method .btn-secondary.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* ???????????????????????????????????????????????????????????????????????????
   Responsive layout ? shell, pages, shared patterns
   Breakpoints: sm 640px � md 768px � lg 1024px
   ??????????????????????????????????????????????????????????????????????????? */

@media (max-width: 767px) {
  .app-nav {
    padding: 0 0.75rem;
    gap: 0.5rem;
  }

  .app-nav-menu-btn {
    display: inline-flex;
  }

  .app-nav-logo-text {
    font-size: 0.9375rem;
  }

  .app-shell-body {
    --shell-nav-sticky-top: 56px;
    --shell-nav-viewport-height: calc(100vh - 56px);
  }

  .shell-content {
    padding: 0.75rem;
    max-width: none;
    margin: 0;
  }

  .shell-layout {
    gap: 0;
    min-height: 0;
  }

  .shell-nav {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: min(17.5rem, 88vw);
    min-height: auto;
    max-height: none;
    align-self: auto;
    z-index: 120;
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    transform: translateX(-105%);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    overscroll-behavior: contain;
    box-shadow: none;
  }

  .shell-nav--drawer-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .shell-nav-backdrop {
    display: block;
  }

  .nav-company-trigger {
    max-width: min(9.5rem, 36vw);
    padding: 0.35rem 0.55rem;
    font-size: 0.8125rem;
  }

  .nav-company-panel {
    right: 0;
    left: auto;
    min-width: min(18rem, calc(100vw - 1.5rem));
  }

  section {
    padding: 1rem 1.125rem;
  }

  h1 {
    font-size: 1.25rem;
  }
}

@media (max-width: 639px) {
  .home-stats-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .section-header > div,
  .section-header .page-actions {
    width: 100%;
  }

  .section-header .page-actions,
  .section-header > div[style*='flex'] {
    justify-content: flex-start;
  }

  .home-card-actions {
    flex-direction: column;
  }

  .home-card-actions .btn-primary,
  .home-card-actions .btn-secondary {
    width: 100%;
  }

  .create-company-actions {
    flex-direction: column;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .info-grid .info-label {
    padding-top: 0;
  }

  .info-grid .info-value + .info-label {
    margin-top: 0.35rem;
  }

  .manual-spreadsheet-workspace__ribbon {
    padding: 0.55rem 0.75rem;
  }

  .manual-spreadsheet-workspace__name {
    max-width: 9rem;
  }

  .excel-formula-bar {
    flex-wrap: wrap;
  }

  .excel-name-box {
    min-width: 3.5rem;
  }

  .twb-toolbar {
    padding: 0.5rem;
  }

  .twb-toolbar__actions {
    width: 100%;
  }

  .section-flyout-nav {
    gap: 0.25rem;
  }

  button.section-flyout-nav__trigger {
    font-size: 0.8125rem;
    padding-left: 0.5rem;
    padding-right: 0.45rem;
  }
}

@media (max-width: 479px) {
  .app-shell-body {
    padding: 0.5rem;
  }

  .app-nav {
    padding: 0 0.5rem;
  }

  .nav-company-trigger {
    max-width: 7.5rem;
  }

  .home-stat-card__value {
    font-size: 1.75rem;
  }
}

.file-import-column-type-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.file-import-column-type-input {
  min-width: 7rem;
  max-width: 100%;
}

.file-import-settings {
  padding: 0.85rem 1rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-bg);
}

.file-import-settings--compact {
  padding: 0.65rem 0.85rem;
}

.file-import-settings__title {
  margin: 0 0 0.65rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.file-import-settings__grid {
  margin-bottom: 0.65rem;
}

.file-import-settings__mapping-title {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
}

.file-import-settings__mapping-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8125rem;
}

.file-import-settings__mapping-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
}

.file-import-settings__mapping-file {
  font-weight: 500;
}

.file-import-settings__mapping-arrow {
  color: var(--c-text-3);
}

.file-import-settings__admin-hint {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
}

.file-import-validation {
  padding: 0.85rem 0;
}

.file-import-validation__title {
  margin: 0 0 0.35rem;
}

.file-import-validation__intro {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
}

.file-import-validation__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.file-import-validation__stat {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.file-import-validation__stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
}

.file-import-validation__stat-label {
  font-size: 0.75rem;
  color: var(--c-text-2);
}

.file-import-validation__rule {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.8125rem;
  margin-bottom: 0.85rem;
  cursor: pointer;
}

.file-import-validation__rule input[type="checkbox"] {
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0.15rem 0 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--c-primary);
  flex-shrink: 0;
}

.file-import-validation__rule input[type="checkbox"]:focus {
  border-color: transparent;
  box-shadow: none;
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.file-import-validation__issues {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-warning-border);
  background: var(--c-warning-bg);
  margin-bottom: 0.65rem;
}

.file-import-validation__issues-title {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-warning-text);
}

.file-import-validation__issues-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  color: var(--c-warning-text);
}

.file-import-validation__ok {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  color: var(--c-success);
}

.file-import-validation__actions {
  margin-top: 0.5rem;
}

.file-import-result-modal {
  max-width: min(24rem, calc(100vw - 2rem));
}

.file-import-result-modal__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.file-import-result-modal__head .clear-period-card__title {
  margin: 0;
}

.file-import-result-modal__icon--ok {
  color: var(--c-success);
  flex-shrink: 0;
}

.file-import-result-modal__icon--err {
  color: var(--c-danger);
  flex-shrink: 0;
}

.file-import-result-modal__file {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
}

.file-import-result-modal__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.file-import-result-modal__stats div {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.file-import-result-modal__stats strong {
  font-size: 1.125rem;
}

.file-import-result-modal__stats span {
  font-size: 0.75rem;
}

.file-import-result-modal__hint {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
}

.file-import-result-modal__actions {
  margin-top: 0.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.file-import-result-modal__download {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}

.file-import-result-modal__reject-preview {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-muted, rgba(0, 0, 0, 0.04));
  font-size: 0.8125rem;
}

.file-import-result-modal__reject-title {
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.file-import-result-modal__reject-list {
  margin: 0;
  padding-left: 1.1rem;
}

.file-import-limits-admin {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
}

.file-import-limits-admin__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.file-import-limits-admin__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

@media (max-width: 639px) {
  .file-import-validation__stats {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .shell-content {
    padding: 1rem;
  }

  .shell-layout {
    gap: 0;
  }

  .shell-nav {
    width: 220px;
  }

  .shell-nav--collapsed {
    width: var(--shell-nav-width-collapsed);
  }
}

/* FortuneSheet workspace (листы / диск) */
.fortune-sheet-workspace__canvas {
  padding: 0;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  width: 100%;
  position: relative;
}

/** Терминал открыт: сетка flex-ом занимает остаток, высота не задаётся в px (без ряби на split). */
.fortune-sheet-workspace__canvas--with-terminal {
  flex: 1 1 auto;
  height: auto;
  max-height: none;
  min-height: 200px;
  overflow: hidden;
}

.fortune-sheet-workspace__split-resize {
  flex: 0 0 6px;
  width: 100%;
  cursor: ns-resize;
  z-index: 6;
  flex-shrink: 0;
  background: #1f2937;
  border: none;
  touch-action: none;
}

.fortune-sheet-workspace__split-resize:hover,
.fortune-sheet-workspace__split-resize:active {
  background: color-mix(in srgb, var(--c-primary) 40%, #1f2937);
}

.fortune-sheet-workspace__split-resize.fortune-sheet-workspace__split-resize--autoload {
  flex: 0 0 4px;
  background: transparent;
  position: relative;
}

.fortune-sheet-workspace__split-resize.fortune-sheet-workspace__split-resize--autoload:hover,
.fortune-sheet-workspace__split-resize.fortune-sheet-workspace__split-resize--autoload:active {
  background: var(--c-primary);
}

.fortune-sheet-workspace__source-wrap {
  flex: 0 0 auto;
  flex-shrink: 0;
  padding: 0.65rem 1rem 0.75rem;
  background: var(--c-surface-2, rgba(0, 0, 0, 0.02));
}

.fortune-sheet-workspace__source-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-border, rgba(0, 0, 0, 0.08));
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.fortune-sheet-workspace__source-wrap .disk-api-sheet__load {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0 0.7rem;
  border: none;
  background: transparent;
}

.fortune-sheet-workspace__source-wrap .disk-api-sheet__load-hint {
  margin: 0;
  padding: 0 1rem;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.fortune-sheet-workspace__source-wrap .load-control-panel {
  margin: 0;
  padding: 0 1rem;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.fortune-sheet-workspace__source-wrap .load-control-panel__header {
  margin-bottom: 0.55rem;
}

.fortune-sheet-workspace__source-main {
  flex: 0 0 auto;
  flex-shrink: 0;
}

.sheet-autoload-pane {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  margin: 0;
  height: auto;
  max-height: none;
  background: transparent;
  color: var(--c-text);
  border: none;
  border-radius: 0;
  overflow: visible;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.sheet-autoload-pane--sized {
  height: var(--source-panel-height);
  max-height: var(--source-panel-height);
  overflow: auto;
}

.sheet-autoload-pane__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

.sheet-autoload-pane__sizer {
  width: 100%;
  padding: 0.15rem 1rem 0.85rem;
  box-sizing: border-box;
}

.sheet-autoload-pane .auto-load-schedule-panel--embedded {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.fortune-sheet-workspace__ribbon-tools {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.fortune-sheet-workspace__ribbon-segment {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  min-height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-sm);
  background: var(--c-nav-hover);
  overflow: hidden;
}

.fortune-sheet-workspace__ribbon-segment .btn-secondary {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.fortune-sheet-workspace__ribbon-segment .btn-secondary + .btn-secondary {
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.fortune-sheet-workspace__ribbon-segment .btn-secondary:hover:not(:disabled) {
  background: var(--c-nav-active);
}

.fortune-sheet-workspace__ribbon-segment .fortune-sheet-workspace__icon-btn--active,
.fortune-sheet-workspace__ribbon-segment .fortune-sheet-workspace__filter-btn--active:not(.fortune-sheet-workspace__filter-btn--pick) {
  background: var(--c-nav-active);
}

.fortune-sheet-workspace__ribbon-segment .disk-file-workspace__terminal-chip.disk-file-workspace__terminal-chip--icon,
.fortune-sheet-workspace__ribbon-segment .disk-file-workspace__share-chip.disk-file-workspace__terminal-chip--icon {
  flex-shrink: 0;
  box-sizing: border-box;
  width: 2rem;
  min-width: 2rem;
  max-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  max-height: 2rem;
  padding: 0;
  background: var(--c-nav-hover);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--c-nav-text);
  box-shadow: none;
}

.fortune-sheet-workspace__ribbon-segment .disk-file-workspace__terminal-chip.disk-file-workspace__terminal-chip--icon:hover:not(:disabled),
.fortune-sheet-workspace__ribbon-segment .disk-file-workspace__terminal-chip.disk-file-workspace__terminal-chip--icon:active:not(:disabled),
.fortune-sheet-workspace__ribbon-segment .disk-file-workspace__terminal-chip.disk-file-workspace__terminal-chip--icon:focus-visible,
.fortune-sheet-workspace__ribbon-segment .disk-file-workspace__terminal-chip.disk-file-workspace__terminal-chip--icon[aria-pressed='true'],
.fortune-sheet-workspace__ribbon-segment .disk-file-workspace__share-chip.disk-file-workspace__terminal-chip--icon:hover:not(:disabled),
.fortune-sheet-workspace__ribbon-segment .disk-file-workspace__share-chip.disk-file-workspace__terminal-chip--icon:active:not(:disabled),
.fortune-sheet-workspace__ribbon-segment .disk-file-workspace__share-chip.disk-file-workspace__terminal-chip--icon:focus-visible,
.fortune-sheet-workspace__ribbon-segment .disk-file-workspace__share-chip.disk-file-workspace__terminal-chip--icon[aria-expanded='true'] {
  width: 2rem;
  min-width: 2rem;
  max-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  max-height: 2rem;
  padding: 0;
  background: var(--c-nav-hover);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--c-nav-text);
  box-shadow: none;
}

.fortune-toolbar {
  overflow: visible;
}

/* Попапы формата (цвет, выравнивание) — дети ленты; hidden их режет, fx перекрывает. */
.sheet-grid-host .fortune-toolbar {
  overflow: visible;
  position: relative;
  z-index: 8;
}

.sheet-grid-host .fortune-fx-editor {
  position: relative;
  z-index: 1;
}

.sheet-grid-host .fortune-toolbar-combo-popup {
  z-index: 10050;
}

.fortune-toolbar-more-container {
  overflow: visible;
  right: 8px;
  max-width: min(348px, calc(100vw - 16px));
}

.fortune-toolbar .fortune-tooltip,
.fortune-toolbar-more-container .fortune-tooltip {
  z-index: 10080;
}

.sheet-grid-host .fortune-toolbar .fortune-tooltip,
.fortune-toolbar-more-container .fortune-tooltip {
  display: none !important;
  visibility: hidden !important;
}

.fortune-toolbar > .fortune-toolbar-button:nth-last-child(-n + 4) .fortune-tooltip,
.fortune-toolbar-more-container .fortune-toolbar-button:nth-child(4n) .fortune-tooltip,
.fortune-toolbar-more-container .fortune-toolbar-button:nth-last-child(-n + 3) .fortune-tooltip {
  right: 0;
  left: auto;
}

.fortune-toolbar .disk-file-share-menu {
  display: inline-flex;
}

.fortune-sheet-workspace__toolbar-tip {
  position: fixed;
  z-index: 10080;
  max-width: min(280px, calc(100vw - 16px));
  padding: 8px 9px;
  border-radius: 2px;
  background: #5f6368;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  pointer-events: none;
}

.fortune-sheet-workspace__ribbon-segment--data .fortune-sheet-workspace__search {
  border: none;
  border-radius: 0;
  background: #fff;
  flex: 1 1 auto;
  min-width: min(14rem, 36vw);
  max-width: 18rem;
}

.fortune-sheet-workspace__ribbon-segment--data .fortune-sheet-workspace__search input {
  border: none;
  background: transparent;
}

.fortune-sheet-workspace__ribbon-segment--data .fortune-sheet-workspace__search input:focus {
  outline: none;
  border-color: transparent;
}

/* Обводка только когда фокус в input — не при клике на ↑↓ / ✕ */
.fortune-sheet-workspace__ribbon-segment--data .fortune-sheet-workspace__search:has(input:focus) {
  outline: none;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c-primary) 45%, transparent);
}

.fortune-sheet-workspace__ribbon-segment--data .fortune-sheet-workspace__filter-btn {
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.fortune-sheet-workspace__loading {
  padding: 1rem 1.25rem;
}

.fortune-sheet-workspace__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0;
  flex-shrink: 0;
}

.fortune-sheet-workspace__icon-btn:has(.fortune-sheet-workspace__fullscreen-label) {
  width: auto;
  min-width: 2rem;
  padding: 0 0.55rem;
  gap: 0.35rem;
}

.fortune-sheet-workspace__fullscreen-label {
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .fortune-sheet-workspace__fullscreen-label {
    display: none;
  }

  .fortune-sheet-workspace__icon-btn:has(.fortune-sheet-workspace__fullscreen-label) {
    width: 2rem;
    padding: 0;
  }
}

.fortune-sheet-workspace__fullscreen-btn--active {
  border-color: rgba(255, 255, 255, 0.35);
}

.fortune-sheet-workspace__save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fortune-sheet-workspace__search {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 12rem;
  max-width: 18rem;
  flex: 1 1 14rem;
}

.fortune-sheet-workspace__search-icon {
  position: absolute;
  left: 0.55rem;
  color: var(--c-text-2, #64748b);
  pointer-events: none;
}

.fortune-sheet-workspace__search input {
  width: 100%;
  height: 2rem;
  padding: 0 1.75rem 0 1.85rem;
  border: 1px solid var(--c-border, rgba(0, 0, 0, 0.12));
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--c-text, #111827);
  font-size: 0.8125rem;
}

/* Свой крестик уже есть — системный ::-webkit-search-cancel-button не показываем. */
.fortune-sheet-workspace__search input[type='search']::-webkit-search-cancel-button,
.fortune-sheet-workspace__search input[type='search']::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.fortune-sheet-workspace__search input::placeholder {
  color: var(--c-text-2, #94a3b8);
}

.fortune-sheet-workspace__search input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 0;
  border-color: rgba(37, 99, 235, 0.55);
}

.fortune-sheet-workspace__search-clear {
  position: absolute;
  right: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent !important;
  color: var(--c-text-2, #64748b);
  cursor: pointer;
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

.fortune-sheet-workspace__search-clear:hover,
.fortune-sheet-workspace__search-clear:focus,
.fortune-sheet-workspace__search-clear:focus-visible,
.fortune-sheet-workspace__search-clear:active {
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--c-text, #111827);
}

.fortune-sheet-workspace__search--find input {
  padding-right: 6.75rem;
}

.fortune-sheet-workspace__find-meta {
  position: absolute;
  right: 4.35rem;
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--c-text-2, #64748b);
  pointer-events: none;
  white-space: nowrap;
}

.fortune-sheet-workspace__find-nav {
  position: absolute;
  right: 1.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.fortune-sheet-workspace__find-nav .fortune-sheet-workspace__search-clear {
  position: static;
}

.sheet-find-hits-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.sheet-find-hits-overlay__band {
  position: absolute;
  background: rgba(167, 139, 250, 0.22);
  border-radius: 0;
  box-sizing: border-box;
}

.sheet-find-hits-overlay__band[data-find-focus='1'] {
  background: rgba(139, 92, 246, 0.38);
  box-shadow: inset 0 0 0 1.5px rgba(109, 40, 217, 0.55);
}

.sheet-find-hits-overlay__band--focus {
  /* legacy */
  background: rgba(139, 92, 246, 0.38);
  box-shadow: inset 0 0 0 1.5px rgba(109, 40, 217, 0.55);
}

.fortune-sheet-workspace__grid-shell--viewport-fetching .sheet-grid-host {
  /* без outline/opacity — иначе «глючит» при каждом Enter/стрелке между страницами */
}

.fortune-sheet-workspace__grid-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.fortune-sheet-workspace__search-count {
  flex-shrink: 0;
  font-size: 0.75rem;
  white-space: nowrap;
}

.fortune-sheet-workspace__filter-btn {
  position: relative;
}

.fortune-sheet-workspace__filter-btn--pick {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.fortune-sheet-workspace__filter-btn--active:not(.fortune-sheet-workspace__filter-btn--pick) {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.42);
}

.fortune-sheet-workspace__filter-badge {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  min-width: 0.95rem;
  height: 0.95rem;
  padding: 0 0.2rem;
  border-radius: var(--radius-full);
  background: #fff;
  color: #5b21b6;
  font-size: 0.5625rem;
  font-weight: 700;
  line-height: 0.95rem;
  text-align: center;
  pointer-events: none;
}

.sheet-grid-host--filters-enabled .luckysheet-cols-h-cells,
.sheet-grid-host--filters-enabled .fortune-col-header-wrap {
  cursor: pointer;
}

/* Встроенный фильтр Fortune (воронка в шапке) — свой слой фильтрации в ленте. */
.sheet-grid-host .luckysheet-filter-options,
.sheet-grid-host .luckysheet-filter-selected {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.sheet-grid-host .fortune-toolbar-button:has(use[href='#filter']),
.sheet-grid-host .fortune-toolbar-button:has(use[xlink\\:href='#filter']) {
  display: none !important;
  pointer-events: none !important;
}

.sheet-column-filter-overlay {
  position: absolute;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  overflow: hidden;
}

.sheet-column-name-overlay {
  position: absolute;
  inset: 0;
  z-index: 115;
  pointer-events: none;
  overflow: hidden;
}

.sheet-column-name-overlay__cell {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0 4px;
  overflow: hidden;
  text-align: center;
  line-height: 1.15;
  font-family: Arial, 'Helvetica Neue', sans-serif;
  color: #0f172a;
  background: #e8eef5;
  border-right: 1px solid #c5d0dc;
}

.sheet-column-name-overlay__parent {
  max-width: 100%;
  font-size: 10px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-column-name-overlay__leaf {
  max-width: 100%;
  font-size: 11px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-column-filter-overlay__header-highlight {
  position: absolute;
  pointer-events: none;
  background: color-mix(in srgb, var(--c-primary) 22%, transparent);
  border: 2px solid color-mix(in srgb, var(--c-primary) 55%, transparent);
  box-sizing: border-box;
}

.sheet-column-filter-overlay__column-band {
  position: absolute;
  pointer-events: none;
  background: color-mix(in srgb, var(--c-primary) 8%, transparent);
}

.sheet-column-filter-overlay__badge {
  position: absolute;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 1px solid #c5d0dc;
  border-radius: 3px;
  background: #fff;
  color: #64748b;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

.sheet-column-filter-overlay__badge:hover {
  background: #f8fafc;
  color: #334155;
}

.sheet-column-filter-overlay__badge--active {
  background: var(--c-primary-bg);
  border-color: var(--c-primary-border);
  color: var(--c-primary);
}

.sheet-google-filter-panel {
  display: flex;
  flex-direction: column;
  width: 17rem;
  max-width: calc(100vw - 1rem);
  max-height: min(70vh, 28rem);
  overflow: hidden;
  padding: 0;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  color: #202124;
  box-shadow: 0 4px 16px rgba(60, 64, 67, 0.28);
  box-sizing: border-box;
}

.sheet-google-filter-panel__scroll {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.sheet-google-filter-panel input[type='checkbox'].sheet-google-filter-panel__checkbox {
  width: 0.875rem;
  height: 0.875rem;
  min-width: 0.875rem;
  max-width: none;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--c-primary);
}

.sheet-google-filter-panel__search-input {
  flex: 1;
  min-width: 0;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0.25rem 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.sheet-google-filter-panel__select,
.sheet-google-filter-panel__input {
  width: 100%;
  max-width: none;
  font-size: 0.8125rem;
  background: #fff;
  color: #202124;
  box-sizing: border-box;
}

.sheet-google-filter-panel__section {
  flex: 0 0 auto;
  padding: 0.35rem 0;
  border-bottom: 1px solid #e8eaed;
}

.sheet-google-filter-panel__section:last-of-type {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-bottom: none;
}

.sheet-google-filter-panel__menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.45rem 0.85rem;
  border: 0;
  background: transparent;
  color: #202124;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.sheet-google-filter-panel__menu-item:hover {
  background: #f1f3f4;
}

.sheet-google-filter-panel__menu-item--toggle {
  font-weight: 500;
}

.sheet-google-filter-panel__subtitle {
  margin: 0;
  padding: 0.45rem 0.85rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #5f6368;
}

.sheet-google-filter-panel__value-toolbar {
  display: flex;
  gap: 0.75rem;
  padding: 0 0.85rem 0.25rem;
}

.sheet-google-filter-panel__section > .sheet-google-filter-panel__link {
  display: block;
  padding: 0.25rem 0.85rem 0.45rem;
  text-align: left;
}

.sheet-google-filter-panel__reset-sort {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  padding: 0.25rem 0.85rem 0.45rem;
  text-align: left;
  color: var(--c-primary);
  font-size: 0.75rem;
  cursor: pointer;
}

.sheet-google-filter-panel__reset-sort:hover {
  color: var(--c-primary-h);
}

.sheet-google-filter-panel__reset-sort-label {
  display: block;
  line-height: 1.35;
}

.sheet-google-filter-panel__reset-sort-hint {
  display: block;
  margin-top: 0.2rem;
  color: #5f6368;
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sheet-google-filter-panel__link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--c-primary);
  font-size: 0.75rem;
  cursor: pointer;
}

.sheet-google-filter-panel__link:hover {
  color: var(--c-primary-h);
}

.sheet-google-filter-panel__menu-item--reset,
.sheet-google-filter-panel__reset-column {
  flex: 0 0 auto;
  color: var(--c-primary);
  border-top: 1px solid #e8eaed;
  border-bottom: 1px solid #e8eaed;
  font-weight: 500;
}

.sheet-google-filter-panel__reset-column:hover {
  background: var(--c-primary-bg);
  color: var(--c-primary-h);
}

.sheet-google-filter-panel__footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border-top: 1px solid #e8eaed;
  background: #f8f9fa;
}

.sheet-google-filter-panel__clear-all {
  align-self: flex-start;
  max-width: 100%;
  font-size: 0.75rem;
  white-space: normal;
  line-height: 1.35;
  text-align: left;
}

.sheet-google-filter-panel__footer-actions {
  display: flex;
  flex-shrink: 0;
  justify-content: flex-end;
  gap: 0.5rem;
}

.sheet-google-filter-panel__footer-actions .btn-sm {
  flex-shrink: 0;
}

.sheet-google-filter-panel__search {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0.85rem 0.35rem;
  padding: 0.25rem 0.45rem;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
}

.sheet-google-filter-panel__search-icon {
  flex-shrink: 0;
  color: #5f6368;
}

.sheet-google-filter-panel__values {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 0.45rem 0.35rem;
}

.sheet-google-filter-panel__value-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.28rem 0.4rem;
  font-size: 0.8125rem;
  font-weight: 400;
  color: #202124;
  cursor: pointer;
  line-height: 1.25;
}

.sheet-google-filter-panel__value-row:hover {
  background: #f8f9fa;
}

.sheet-google-filter-panel__value-row--all {
  margin: 0 0.45rem;
  border-bottom: 1px solid #e8eaed;
  padding-bottom: 0.35rem;
  margin-bottom: 0.15rem;
}

.sheet-google-filter-panel__value-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-google-filter-panel__condition {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.25rem 0.85rem 0.45rem;
}

.sheet-google-filter-panel__empty {
  margin: 0;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
}

.sheet-filter-pick-banner {
  background: var(--c-primary-bg);
  color: var(--c-primary);
}

.sheet-grid-host--filter-pick .fortune-cell-area,
.sheet-grid-host--filter-pick .luckysheet-cell-main {
  cursor: crosshair;
}

/* При сохранении — бледно-белая непрозрачная кнопка (как в Word) */
.fortune-sheet-workspace__save-btn--active,
.manual-spreadsheet-workspace__ribbon-end .fortune-sheet-workspace__save-btn--active {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.98);
  color: #5b21b6;
  box-shadow: none;
}

.fortune-sheet-workspace__save-btn--active:hover:not(:disabled),
.manual-spreadsheet-workspace__ribbon-end .fortune-sheet-workspace__save-btn--active:hover:not(:disabled) {
  background: #fff;
  border-color: #fff;
  color: #4c1d95;
}

/* API-таблица с диска — сетка как у листа + панель снимка */
.disk-api-sheet__load {
  flex-shrink: 0;
  padding: 0.65rem 1rem 0.75rem;
  border-bottom: 1px solid var(--c-border, rgba(0, 0, 0, 0.08));
  background: var(--c-surface-2, rgba(0, 0, 0, 0.02));
}

.auto-load-schedule-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.15fr);
  gap: 0.85rem 1rem;
  align-items: stretch;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--c-border, rgba(0, 0, 0, 0.08));
}

.auto-load-schedule-panel--embedded {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.15fr);
  gap: 0.85rem 1rem;
  align-items: stretch;
}

@media (max-width: 820px) {
  .auto-load-schedule-panel--embedded {
    grid-template-columns: 1fr;
  }
}

.auto-load-schedule-panel__form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.sheet-api-terminal {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 160px;
  max-height: 280px;
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #1f2937;
  border-radius: 6px;
  overflow: hidden;
}

.sheet-api-terminal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.28rem 0.55rem;
  background: #1f2937;
  border-bottom: 1px solid #111827;
  flex-shrink: 0;
}

.sheet-api-terminal__title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c4b5fd;
}

.sheet-api-terminal__log {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0.45rem 0.55rem;
  overflow: auto;
  font-size: 0.72rem;
}

.auto-load-schedule-panel__pause {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--c-danger, #ef4444) 35%, var(--c-border, #e5e7eb));
  border-radius: var(--radius, 6px);
  background: color-mix(in srgb, var(--c-danger, #ef4444) 8%, var(--c-surface, #fff));
}

.auto-load-schedule-panel__pause-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-danger, #b91c1c);
}

.auto-load-schedule-panel__pause-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.auto-load-schedule-panel__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: auto;
  margin: 0 0 0.65rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.auto-load-schedule-panel__toggle input[type='checkbox'] {
  width: 1rem;
  height: 1rem;
  max-width: 1rem;
  margin: 0;
  padding: 0;
  flex: 0 0 1rem;
  border: 0;
  border-radius: 3px;
  box-shadow: none;
  background: transparent;
  accent-color: var(--c-primary, #7c3aed);
}

.auto-load-schedule-panel__toggle input[type='checkbox']:focus {
  box-shadow: none;
  outline: 2px solid var(--c-primary, #7c3aed);
  outline-offset: 2px;
}

.auto-load-schedule-panel__label {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-2, #64748b);
}

.auto-load-schedule-panel__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.auto-load-schedule-panel__chip {
  border: 1px solid var(--c-border, #e5e7eb);
  background: var(--c-surface, #fff);
  color: var(--c-text, #111);
  padding: 0.28rem 0.65rem;
  font-size: 0.8125rem;
  cursor: pointer;
}

.auto-load-schedule-panel__chip.is-active {
  border-color: var(--c-primary, #7c3aed);
  background: var(--c-primary-bg, #f5f3ff);
  color: var(--c-primary, #7c3aed);
}

.auto-load-schedule-panel__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.auto-load-schedule-panel__field {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  width: auto;
  font-size: 0.8125rem;
  margin-bottom: 0.75rem;
}

.auto-load-schedule-panel__field-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.auto-load-schedule-panel__field-block .auto-load-schedule-panel__field {
  margin-bottom: 0;
}

.auto-load-schedule-panel__hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  max-width: 28rem;
}

.auto-load-schedule-panel__field input,
.auto-load-schedule-panel__field select {
  width: auto;
  min-width: 5.5rem;
  max-width: 10rem;
  min-height: 2rem;
  padding: 0.2rem 0.45rem;
  font: inherit;
  border: 1px solid var(--c-border, #e5e7eb);
  background: var(--c-surface, #fff);
  color: inherit;
}

.auto-load-schedule-panel__slots {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  width: 100%;
  margin-bottom: 0.65rem;
}

.auto-load-schedule-panel__slots-empty {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
}

.auto-load-schedule-panel__slot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--c-border, #e5e7eb);
  width: 100%;
  max-width: 16rem;
}

.auto-load-schedule-panel__slot-row select {
  width: 3.6rem;
  min-width: 3.6rem;
  max-width: 3.6rem;
  min-height: 1.85rem;
  padding: 0.15rem 0.25rem;
  font: inherit;
  font-size: 0.8125rem;
  border: 1px solid var(--c-border, #e5e7eb);
  background: var(--c-surface, #fff);
  color: inherit;
}

.auto-load-schedule-panel__slot-row input {
  width: 4.25rem;
  min-width: 4.25rem;
  max-width: 4.25rem;
  min-height: 1.85rem;
  padding: 0.15rem 0.35rem;
  font: inherit;
  font-size: 0.8125rem;
  border: 1px solid var(--c-border, #e5e7eb);
  background: var(--c-surface, #fff);
  color: inherit;
}

.auto-load-schedule-panel__slot-remove {
  border: none;
  background: transparent;
  color: var(--c-text-3, #9ca3af);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.2rem;
}

.auto-load-schedule-panel__slot-remove:hover:not(:disabled) {
  color: var(--c-danger, #ef4444);
}

.auto-load-schedule-panel__slot-add {
  border: none;
  background: transparent;
  color: var(--c-primary, #7c3aed);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0;
  margin-top: 0.1rem;
}

.auto-load-schedule-panel__slot-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auto-load-schedule-panel__meta {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  color: var(--c-text-2, #64748b);
}

.auto-load-schedule-panel__err {
  color: var(--c-danger, #dc2626);
}

.auto-load-schedule-panel__next {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  color: var(--c-text-2, #64748b);
}

.auto-load-schedule-panel__status {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  color: var(--c-text-2, #64748b);
}

.disk-sheet-bootstrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--c-border, rgba(0, 0, 0, 0.08));
  background: var(--c-surface-2, rgba(0, 0, 0, 0.02));
}

.disk-sheet-bootstrap__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.disk-sheet-bootstrap__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.disk-sheet-bootstrap__hint,
.disk-sheet-bootstrap__error {
  margin: 0;
  font-size: 0.8125rem;
}

/* Hint/error внутри общей панели действий — на всю ширину ряда */
.disk-sheet-bootstrap__actions > .disk-sheet-bootstrap__hint,
.disk-sheet-bootstrap__actions > .disk-sheet-bootstrap__error {
  flex: 1 0 100%;
}

/* Разделы файла — кнопка + выпадающий список (как меню «⋯» на диске) */
.disk-file-section-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.45rem 1rem;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.disk-file-section-menu {
  flex-shrink: 0;
}

.disk-file-section-menu__trigger--ribbon {
  background: var(--c-nav-hover);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--c-nav-text);
}

.disk-file-section-menu__trigger--ribbon:hover:not(:disabled) {
  background: var(--c-nav-active);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.disk-file-section-menu--ribbon .tables-fs-row-menu__dropdown {
  left: 0;
  right: auto;
  min-width: 14rem;
}

.disk-file-more-menu .tables-fs-row-menu__dropdown {
  left: 0;
  right: auto;
  min-width: 16.5rem;
}

.disk-file-more-menu__trigger {
  background: var(--c-nav-hover);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--c-nav-text);
}

.disk-file-more-menu__trigger:hover:not(:disabled) {
  background: var(--c-nav-active);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.disk-file-more-menu__sep {
  height: 1px;
  margin: 0.35rem 0;
  background: #e8eaed;
}

.disk-file-more-menu__item-text {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.disk-file-more-menu__item--soon {
  opacity: 0.45;
  cursor: not-allowed;
}

.disk-file-more-menu__danger {
  color: #c5221f;
}

.disk-file-more-menu__danger .tables-fs-row-menu__item-icon {
  color: #c5221f;
}

.disk-file-section-menu .tables-fs-row-menu__dropdown button {
  justify-content: flex-start;
}

.disk-file-section-menu__item-text {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.disk-file-section-menu__check {
  display: inline-flex;
  color: #1a73e8;
  margin-left: 0.25rem;
}

.disk-file-section-menu__item--soon {
  opacity: 0.45;
  cursor: not-allowed;
}

.disk-file-ribbon-cluster {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 0 1 auto;
}

.disk-file-ribbon-menus {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
}

.disk-file-ribbon-hosts {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.disk-file-ribbon-text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  height: 2rem;
  padding: 0 0.55rem;
  width: auto;
  min-width: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-nav-text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
}

.disk-file-ribbon-text-btn:hover:not(:disabled),
.disk-file-ribbon-text-btn[aria-expanded='true'] {
  background: var(--c-nav-hover);
  color: #fff;
}

.disk-file-ribbon-text-btn.disk-file-more-menu__trigger,
.disk-file-ribbon-text-btn.disk-file-section-menu__trigger--ribbon {
  background: transparent;
  border-color: transparent;
  color: var(--c-nav-text);
}

.disk-file-ribbon-text-btn.disk-file-more-menu__trigger:hover:not(:disabled),
.disk-file-ribbon-text-btn.disk-file-section-menu__trigger--ribbon:hover:not(:disabled),
.disk-file-ribbon-text-btn.disk-file-more-menu__trigger[aria-expanded='true'],
.disk-file-ribbon-text-btn.disk-file-section-menu__trigger--ribbon[aria-expanded='true'] {
  background: var(--c-nav-hover);
  border-color: transparent;
  color: #fff;
}

.disk-file-ribbon-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin: 0;
}

.disk-file-ribbon-actions .manual-spreadsheet-workspace__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.disk-file-ribbon-actions .btn-secondary,
.disk-file-ribbon-actions .btn-primary {
  background: var(--c-nav-hover);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--c-nav-text);
}

.disk-file-ribbon-actions .btn-secondary:hover:not(:disabled),
.disk-file-ribbon-actions .btn-primary:hover:not(:disabled) {
  background: var(--c-nav-active);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.disk-file-ribbon-actions .fortune-sheet-workspace__save-btn--active {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.98);
  color: #5b21b6;
}

.disk-file-ribbon-actions .fortune-sheet-workspace__save-btn--active:hover:not(:disabled) {
  background: #fff;
  border-color: #fff;
  color: #4c1d95;
}

.disk-file-ribbon-actions .fortune-sheet-workspace__fullscreen-btn--active,
.disk-file-ribbon-actions .disk-file-tools-toggle--open {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.16);
}

.disk-file-section-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.125rem;
  padding: 3px;
  margin: 0;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--c-bg) 90%, var(--c-border) 10%);
  border: 1px solid var(--c-border);
  max-width: 520px;
  flex: 1 1 auto;
}

.disk-file-section-tabs--ribbon {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  width: 100%;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.disk-file-section-tabs--ribbon .disk-file-section-tabs__tab {
  color: rgba(255, 255, 255, 0.78);
  flex: 1 1 0;
}

.disk-file-section-tabs--ribbon .disk-file-section-tabs__tab:hover:not(.disk-file-section-tabs__tab--disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.disk-file-section-tabs--ribbon .disk-file-section-tabs__tab--active {
  background: rgba(255, 255, 255, 0.92);
  color: #5b21b6;
}

.disk-file-section-tabs--ribbon .disk-file-section-tabs__soon {
  color: rgba(255, 255, 255, 0.45);
}

.disk-file-section-tabs--ribbon .disk-file-section-tabs__tab--active .disk-file-section-tabs__soon {
  color: #a78bfa;
}

.disk-file-ribbon-menus .disk-file-workspace__terminal-chip.disk-file-workspace__terminal-chip--icon,
.disk-file-ribbon-menus .disk-file-workspace__share-chip.disk-file-workspace__terminal-chip--icon {
  flex-shrink: 0;
  box-sizing: border-box;
  width: 2rem;
  min-width: 2rem;
  max-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  max-height: 2rem;
  padding: 0;
  background: var(--c-nav-hover);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--c-nav-text);
  box-shadow: none;
}

.disk-file-ribbon-menus .disk-file-workspace__terminal-chip.disk-file-workspace__terminal-chip--icon:hover:not(:disabled),
.disk-file-ribbon-menus .disk-file-workspace__terminal-chip.disk-file-workspace__terminal-chip--icon:active:not(:disabled),
.disk-file-ribbon-menus .disk-file-workspace__terminal-chip.disk-file-workspace__terminal-chip--icon:focus-visible,
.disk-file-ribbon-menus .disk-file-workspace__terminal-chip.disk-file-workspace__terminal-chip--icon[aria-pressed='true'],
.disk-file-ribbon-menus .disk-file-workspace__share-chip.disk-file-workspace__terminal-chip--icon:hover:not(:disabled),
.disk-file-ribbon-menus .disk-file-workspace__share-chip.disk-file-workspace__terminal-chip--icon:active:not(:disabled),
.disk-file-ribbon-menus .disk-file-workspace__share-chip.disk-file-workspace__terminal-chip--icon:focus-visible,
.disk-file-ribbon-menus .disk-file-workspace__share-chip.disk-file-workspace__terminal-chip--icon[aria-expanded='true'] {
  width: 2rem;
  min-width: 2rem;
  max-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  max-height: 2rem;
  padding: 0;
  background: var(--c-nav-hover);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--c-nav-text);
  box-shadow: none;
}

.disk-file-workspace.manual-spreadsheet-workspace--embedded {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.disk-file-workspace .manual-spreadsheet-workspace__ribbon {
  flex-wrap: nowrap;
}

.disk-file-workspace .manual-spreadsheet-workspace__brand {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  gap: 0.45rem;
  position: relative;
}

.disk-file-workspace .manual-spreadsheet-workspace__name {
  color: var(--c-nav-text);
  margin: 0;
}

.disk-file-workspace .manual-spreadsheet-workspace__ribbon-end {
  flex-shrink: 0;
  margin-left: 0.75rem;
}

.disk-file-document-meta-slot {
  flex-shrink: 0;
  width: 100%;
  background: #fff;
}

.disk-file-document-meta-grid {
  display: flex;
  flex-direction: row;
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #d4d4d4;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  line-height: 1;
  color: #000;
}

.disk-file-document-meta-grid__row-head {
  flex-shrink: 0;
  box-sizing: border-box;
  background: #f5f5f5;
  border-right: 1px solid #d4d4d4;
}

.disk-file-document-meta-grid__num {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  color: #5e5e5e;
  font-size: 11px;
  border-bottom: 1px solid #e0e0e0;
  user-select: none;
}

.disk-file-document-meta-grid__num:last-child {
  border-bottom: none;
}

.disk-file-document-meta-grid__resize {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  z-index: 2;
  height: 5px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: ns-resize;
  user-select: none;
}

.disk-file-document-meta-grid__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.disk-file-document-meta-grid__clip {
  min-width: 0;
  overflow: hidden;
}

.disk-file-document-meta-grid__cells {
  display: flex;
  flex-direction: row;
  will-change: transform;
}

.disk-file-document-meta-grid__input {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 4px;
  border: 0;
  border-right: 1px solid #e0e0e0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  line-height: 17px;
  box-sizing: border-box;
}

.disk-file-document-meta-grid__input:last-child {
  border-right: none;
}

.disk-file-document-meta-grid__input--line {
  flex: 0 0 auto;
  width: 100%;
  resize: none;
  overflow-x: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  padding: 1px 8px;
  border: 0;
  border-right: none;
  border-bottom: 1px solid #e0e0e0;
  user-select: text;
}

.disk-file-document-meta-grid__input--line:last-of-type {
  border-bottom: none;
}

.disk-file-row-header-slot {
  flex-shrink: 0;
  width: 0;
  position: relative;
  z-index: 6;
  overflow: visible;
}

.disk-file-row-header-slot__outline {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  pointer-events: none;
  background: #eef2f7;
  border: none;
}

.disk-file-column-header-slot {
  flex-shrink: 0;
  width: 100%;
  overflow: visible;
  z-index: 6;
  /* Буквы накрывают нативную шапку Fortune (20px); строка имён остаётся в потоке и не заезжает на ячейки. */
  margin-bottom: -20px;
  background: transparent;
  pointer-events: none;
}

.disk-file-column-header-grid {
  position: relative;
  display: flex;
  flex-direction: row;
  width: 100%;
  overflow: visible;
  background: #f8fafc;
  border-bottom: 1px solid #c5d0dc;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  line-height: 1.2;
  color: #0f172a;
  pointer-events: auto;
}

.disk-file-column-header-grid__outline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 1;
  box-sizing: border-box;
  pointer-events: none;
  background: #eef2f7;
  border-bottom: 1px solid #c5d0dc;
}

.disk-file-column-header-grid__badge {
  position: absolute;
  top: 2px;
  right: 8px;
  z-index: 3;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  pointer-events: none;
  user-select: none;
}

.disk-file-column-header-grid__row-head {
  position: relative;
  z-index: 8;
  flex-shrink: 0;
  box-sizing: border-box;
  background: #eef2f7;
  border-right: 1px solid #c5d0dc;
  pointer-events: auto;
}

.disk-file-column-header-grid__num {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  border-bottom: 1px solid #dbe3ec;
  user-select: none;
}

.disk-file-column-header-grid__num:last-child {
  border-bottom: none;
}

.disk-file-column-header-grid__section-slot,
.disk-file-column-header-grid__section-slot-num {
  box-sizing: border-box;
  background: #eef2f7;
  border: none;
  pointer-events: none;
}

.disk-file-column-header-grid__section-slot {
  position: absolute;
  z-index: 1;
}

.disk-file-column-header-grid__num--axis {
  background: var(--c-primary, #7c3aed) !important;
  color: #fff !important;
  cursor: pointer;
}

.disk-file-column-header-grid__num--selected {
  background: color-mix(in srgb, var(--c-primary, #7c3aed) 16%, #eef2f7);
  color: #4c1d95;
  cursor: pointer;
}

.disk-file-column-header-grid__num--letter,
.disk-file-column-header-grid__num {
  cursor: pointer;
}

.disk-file-column-header-grid__body {
  position: relative;
  flex: 1;
  min-width: 0;
}

.disk-file-column-header-grid__frozen {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  overflow: hidden;
  background: #f8fafc;
  pointer-events: auto;
}

.disk-file-column-header-grid__freeze-line {
  position: absolute;
  top: 0;
  z-index: 5;
  width: 1px;
  background: #64748b;
  pointer-events: none;
}

.disk-file-column-header-grid__filter {
  position: absolute;
  top: 50%;
  right: 4px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 1px solid #c5d0dc;
  border-radius: 3px;
  background: #fff;
  color: #64748b;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  transform: translateY(-50%);
  cursor: pointer;
}

.disk-file-column-header-grid__filter:hover {
  background: #f8fafc;
  color: #334155;
}

.disk-file-column-header-grid__filter--active {
  background: var(--c-primary-bg, #ede9fe);
  border-color: var(--c-primary-border, #c4b5fd);
  color: var(--c-primary, #6d28d9);
}

.disk-file-column-header-grid__cell--filterable {
  padding-right: 22px;
}

.disk-file-column-header-grid__clip {
  min-width: 0;
  overflow: hidden;
}

.disk-file-column-header-grid__canvas {
  position: relative;
  will-change: transform;
}

.disk-file-column-header-grid__cell {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  /* Полная ширина visibledatacolumn: буквы и имя — один прямоугольник со столбцом сетки. */
  border-right: 1px solid #c5d0dc;
  border-bottom: 1px solid #c5d0dc;
  background: #e8eef5;
  overflow: hidden;
  cursor: context-menu;
}

.disk-file-column-header-grid__cell--reorder {
  cursor: grab;
}

.disk-file-column-header-grid__cell--reorder-from {
  background: var(--c-primary, #7C3AED) !important;
  color: #fff !important;
  border-color: var(--c-primary-h, #6D28D9);
}

.disk-file-column-header-grid__cell--selected {
  z-index: 2;
  background: color-mix(in srgb, var(--c-primary, #7c3aed) 16%, #e8eef5) !important;
  color: #4c1d95;
}

.disk-file-column-header-grid__cell--letter.disk-file-column-header-grid__cell--selected {
  background: color-mix(in srgb, var(--c-primary, #7c3aed) 16%, #f1f5f9) !important;
  border-bottom-color: color-mix(in srgb, var(--c-primary, #7c3aed) 16%, #f1f5f9);
}

.disk-file-column-header-grid__cell--header-focus {
  box-shadow: inset 0 0 0 2px var(--c-primary, #7c3aed);
}

.disk-file-column-header-grid__cell--axis,
.disk-file-column-header-grid__cell--letter.disk-file-column-header-grid__cell--axis,
.disk-file-column-header-grid__cell--letter.disk-file-column-header-grid__cell--selected.disk-file-column-header-grid__cell--axis {
  background: var(--c-primary, #7c3aed) !important;
  color: #fff !important;
  border-color: var(--c-primary, #7c3aed);
}

.disk-file-column-header-grid__insert {
  position: absolute;
  top: 0;
  z-index: 8;
  width: 3px;
  margin-left: -1px;
  background: var(--c-primary, #7C3AED);
  pointer-events: none;
}

body.sheet-grid-reordering-col,
body.sheet-grid-reordering-col * {
  cursor: grabbing !important;
  user-select: none !important;
}

body.sheet-grid-reordering-col .disk-file-column-header-grid__resize {
  pointer-events: none;
}

body.sheet-grid-reordering-row,
body.sheet-grid-reordering-row * {
  cursor: grabbing !important;
  user-select: none !important;
}

.sheet-grid-host--row-reorder .fortune-row-header,
.sheet-grid-host--row-reorder .luckysheet-rows-h {
  cursor: grab;
}

.disk-file-column-header-grid__cell--editable {
  cursor: text;
}

.disk-file-column-header-grid__cell--editable.disk-file-column-header-grid__cell--reorder {
  cursor: grab;
}

.disk-file-column-header-grid__input {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 2px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  outline: none;
  box-shadow: none;
  caret-color: #0f172a;
  pointer-events: auto;
}

.disk-file-column-header-grid__cell-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
}

.disk-file-column-header-grid__cell--dropdown {
  box-sizing: border-box;
}

.disk-file-column-header-grid__cell--dropdown .disk-file-column-header-grid__cell-text {
  padding-right: 14px;
  padding-left: 2px;
  text-align: center;
}

.disk-file-column-header-grid__dropdown-mark {
  position: absolute;
  /* Canvas ▾: центр в endX - 10. Ячейка шапки border-box + border-right 1px. */
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  font-size: 9px;
  line-height: 1;
  color: var(--c-text-2);
  pointer-events: none;
  text-align: center;
}

.disk-file-column-header-grid__resize {
  position: absolute;
  top: 0;
  z-index: 5;
  width: 6px; /* уменьшено с 8px до 6px */
  padding: 0;
  border: none;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
  /* Кнопка теперь полностью в текущем столбце, не заходит в следующий */
  transform: translateX(-3px);
}

.disk-file-column-header-grid__resize:hover {
  background: color-mix(in srgb, var(--c-primary) 40%, transparent);
}

.disk-file-column-header-grid__cell--group {
  background-color: #e2e8f0;
  color: #475569;
  font-size: 10px;
  font-weight: 600;
}

.disk-file-column-header-grid__cell--leaf {
  background-color: #e8eef5;
  color: #0f172a;
  font-size: 11px;
  font-weight: 600;
}

.disk-file-column-header-grid__cell--single {
  background-color: #e8eef5;
  color: #0f172a;
  font-size: 11px;
  font-weight: 600;
}

.sheet-grid-host--external-column-header .fortune-col-header,
.sheet-grid-host--external-column-header .fortune-cols-header {
  background: #f1f5f9;
}

.sheet-grid-host--hide-fortune-col-header .fortune-col-header-wrap,
.sheet-grid-host--hide-fortune-col-header .fortune-cols-header,
.sheet-grid-host--hide-fortune-col-header .fortune-col-header,
.sheet-grid-host--hide-fortune-col-header .fortune-cols-change-size,
.sheet-grid-host--hide-fortune-col-header .fortune-cols-freeze-handle {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.disk-file-column-header-grid__cell--letter {
  background-color: #f1f5f9;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  z-index: 1;
}

.disk-file-column-header-grid__num--letter {
  background: #eef2f7;
}

.disk-file-column-header-grid__num--letter.disk-file-column-header-grid__num--axis,
.disk-file-column-header-grid__num--axis {
  background: var(--c-primary, #7c3aed) !important;
  color: #fff !important;
}

.column-group-overlay {
  background: transparent;
  border-bottom: none;
  overflow: visible;
  pointer-events: auto;
}

.row-group-overlay {
  overflow: visible;
  pointer-events: auto;
  background: transparent;
}

.column-group-overlay__menu,
.row-group-overlay__menu,
.sheet-group-outline-menu {
  position: fixed;
  z-index: 10052;
  min-width: 17.5rem;
  padding: 6px 0;
  box-sizing: border-box;
  pointer-events: auto;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 4px;
  box-shadow: 0 2px 6px 2px rgba(60, 64, 67, 0.15);
  font-family: Arial, Helvetica, sans-serif;
}

.column-group-overlay__menu button,
.row-group-overlay__menu button,
.sheet-group-outline-menu button {
  display: block !important;
  width: 100% !important;
  min-height: 32px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 16px !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #202124 !important;
  font: 400 13px Arial, Helvetica, sans-serif !important;
  line-height: 20px !important;
  text-align: left !important;
  cursor: pointer;
}

.column-group-overlay__menu button:hover,
.row-group-overlay__menu button:hover,
.sheet-group-outline-menu button:hover,
.column-group-overlay__menu button:hover:not(:disabled),
.row-group-overlay__menu button:hover:not(:disabled),
.sheet-group-outline-menu button:hover:not(:disabled) {
  background: #f1f3f4 !important;
  color: #202124 !important;
}

.column-group-overlay__menu button:disabled,
.row-group-overlay__menu button:disabled,
.sheet-group-outline-menu button:disabled {
  color: #9aa0a6 !important;
  cursor: default !important;
  background: transparent !important;
}

/* Не попадать под `.sheet-grid-host > div` (flex:1) — иначе полоса
   растягивается на всю сетку и блокирует клики по ячейкам и спискам. */
.sheet-grid-host > .column-group-overlay,
.sheet-grid-host > .row-group-overlay {
  flex: none;
  display: block;
  width: auto;
  height: auto;
  min-height: 0;
  pointer-events: none;
}

.column-group-overlay canvas,
.row-group-overlay canvas {
  pointer-events: none;
}

.column-group-overlay__btn,
.row-group-overlay__btn,
.sheet-group-outline-btn {
  box-sizing: border-box !important;
  flex: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 2px !important;
  box-shadow: none !important;
  font-size: 0 !important;
  line-height: 0 !important;
  letter-spacing: 0 !important;
  overflow: hidden !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  cursor: pointer !important;
  pointer-events: auto;
  position: absolute;
  transition: none !important;
}

.sheet-group-outline-btn--expanded {
  background: #ffffff !important;
  border: 1px solid #80868b !important;
}

.sheet-group-outline-btn--expanded::before {
  content: '';
  width: 8px;
  height: 1px;
  background: #5f6368;
}

.sheet-group-outline-btn--collapsed {
  background: #5f6368 !important;
  border: none !important;
}

.sheet-group-outline-btn--collapsed::before,
.sheet-group-outline-btn--collapsed::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 0;
  background: #ffffff;
}

.sheet-group-outline-btn--collapsed::before {
  width: 8px;
  height: 1.5px;
}

.sheet-group-outline-btn--collapsed::after {
  width: 1.5px;
  height: 8px;
}

.sheet-group-outline-btn--expanded:hover,
.sheet-group-outline-btn--expanded:hover:not(:disabled) {
  border-color: var(--c-primary) !important;
  background: var(--c-primary-bg) !important;
}

.sheet-group-outline-btn--expanded:hover::before {
  background: var(--c-primary);
}

.sheet-group-outline-btn--collapsed:hover,
.sheet-group-outline-btn--collapsed:hover:not(:disabled) {
  background: #3c4043 !important;
}

.disk-file-document-meta-grid__input:focus,
.disk-file-document-meta-grid__input--line:focus {
  outline: 2px solid color-mix(in srgb, var(--c-primary) 55%, transparent);
  outline-offset: -2px;
  background: #fff;
}

.disk-file-section-tabs__tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 27px;
  height: 27px;
  padding: 0 0.65rem;
  border: none;
  border-radius: calc(var(--radius-sm) + 1px);
  background: transparent;
  color: var(--c-text-2);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.disk-file-section-tabs__tab:hover:not(.disk-file-section-tabs__tab--disabled) {
  background: color-mix(in srgb, var(--c-surface) 72%, transparent);
  color: var(--c-text);
}

.disk-file-section-tabs__tab--active {
  background: var(--c-surface);
  color: var(--c-text);
}

.disk-file-section-tabs__tab--disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.disk-file-section-tabs__soon {
  margin-left: 0.35rem;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-3);
}

.disk-file-workspace__terminal-chip {
  position: relative;
}

.disk-file-workspace__terminal-chip--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fortune-sheet-workspace__icon-btn--active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.42);
  color: #fff;
}

.disk-file-workspace__terminal-badge {
  position: absolute;
  top: -0.45rem;
  right: -0.35rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #fff;
  color: #5b21b6;
  border: 1px solid rgba(91, 33, 182, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  line-height: 1;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.16);
  pointer-events: none;
}

/* Save active на светлой панели (не в фиолетовой ленте) */
.disk-file-toolbar .fortune-sheet-workspace__save-btn--active {
  background: var(--c-primary-bg);
  border-color: var(--c-primary-border);
  color: var(--c-primary-h);
  box-shadow: none;
}

.disk-file-toolbar .fortune-sheet-workspace__save-btn--active:hover:not(:disabled) {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}

.disk-file-toolbar .fortune-sheet-workspace__fullscreen-btn--active {
  border-color: var(--c-border-strong);
}

/* Раздел 1 · БД */
.disk-file-db {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0.75rem 1rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.disk-file-db__sheet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem 0;
  border-bottom: 1px solid var(--c-border);
  background: color-mix(in srgb, var(--c-surface-2, #f8fafc) 80%, transparent);
}

.disk-file-db__sheet-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.85rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--c-text-2);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.disk-file-db__sheet-tab:hover {
  background: color-mix(in srgb, var(--c-surface) 70%, transparent);
  color: var(--c-text);
}

.disk-file-db__sheet-tab.is-active {
  background: var(--c-surface);
  border-color: var(--c-border);
  border-bottom-color: var(--c-surface);
  color: var(--c-text);
  margin-bottom: -1px;
}

.disk-file-db__sheet-tab-badge {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-text-3);
}

.disk-file-db__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.disk-file-db__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.disk-file-db__meta {
  font-size: 0.75rem;
  color: var(--c-text-2);
}

.disk-file-db__loading {
  padding: 1rem 0.85rem;
}

.disk-file-db__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--c-text-2);
  background:
    radial-gradient(circle at 30% 20%, rgba(124, 58, 237, 0.06), transparent 45%),
    var(--c-surface);
}

.disk-file-db__empty h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--c-text);
}

.disk-file-db__empty p {
  margin: 0;
  max-width: 36rem;
  font-size: 0.875rem;
  line-height: 1.45;
}

.disk-file-db__empty-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.disk-file-db__table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.disk-file-db__table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.disk-file-db__table th,
.disk-file-db__table td {
  padding: 0.4rem 0.65rem;
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  white-space: nowrap;
}

.disk-file-db__table th {
  position: sticky;
  top: 0;
  background: var(--c-bg);
  font-weight: 600;
  color: var(--c-text-2);
  z-index: 1;
}

.disk-file-db__more {
  margin: 0;
  padding: 0.5rem 0.85rem;
  border-top: 1px solid var(--c-border);
}

.disk-load-replace-ack {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--c-text);
  cursor: pointer;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.disk-load-replace-ack input[type='checkbox'] {
  width: 1rem;
  height: 1rem;
  max-width: none;
  margin: 0.15rem 0 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--c-primary);
}

.disk-load-replace-ack span {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: break-word;
}

.sheet-rows-truncation-banner {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--c-warning, #b45309) 35%, var(--c-border));
  background: color-mix(in srgb, var(--c-warning, #b45309) 12%, transparent);
  color: var(--c-text);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.sheet-viewport-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem 0.75rem;
  margin: 0;
  padding: 0.35rem 0.5rem 0.15rem;
  border: none;
  background: transparent;
  color: var(--c-text);
  font-size: 0.8125rem;
  line-height: 1.35;
  flex: 0 0 auto;
}

.sheet-viewport-pager--footer {
  margin-top: 0;
  border-top: 1px solid var(--c-border, rgba(0, 0, 0, 0.08));
  padding: 0.35rem 0.5rem;
  flex: 0 0 auto;
  background: var(--c-surface, #fff);
}

.fortune-sheet-workspace__canvas > .sheet-grid-host,
.fortune-sheet-workspace__canvas > .fortune-sheet-workspace__loading {
  flex: 1 1 auto;
  min-height: 0;
}

.sheet-viewport-pager__fetching {
  color: var(--c-text-2, #64748b);
  font-size: 0.75rem;
}

.sheet-viewport-pager__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sheet-viewport-pager__controls .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.sheet-viewport-pager__page {
  min-width: 4.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sheet-viewport-pager__jump {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.sheet-viewport-pager__jump input {
  width: 3.25rem;
  padding: 0.2rem 0.35rem;
  text-align: center;
  font: inherit;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: var(--c-bg, #fff);
  color: inherit;
}

.disk-file-db__truncation {
  margin-bottom: 0.75rem;
}

.disk-load-import-preview {
  width: min(760px, calc(100vw - 2rem));
  max-width: min(760px, calc(100vw - 2rem));
  max-height: min(92vh, 860px);
  overflow: auto;
  box-sizing: border-box;
}

.disk-load-import-preview__intro {
  margin-bottom: 0.35rem;
}

.disk-load-import-preview__summary {
  margin: 0.75rem 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: var(--c-primary-bg);
  border: 1px solid color-mix(in srgb, var(--c-primary) 18%, transparent);
}

.disk-load-import-preview__summary-main {
  margin: 0;
  font-size: 0.9375rem;
}

.disk-load-import-preview__summary-sub {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
}

.disk-load-import-preview__field--sheet {
  margin-bottom: 0.65rem;
}

.disk-load-import-preview__step {
  margin-bottom: 0.85rem;
}

.disk-load-import-preview__step-title {
  margin: 0 0 0.45rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.disk-load-import-preview__toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--c-text);
  line-height: 1.4;
  cursor: pointer;
}

.disk-load-import-preview__toggle input[type='checkbox'] {
  width: 1rem;
  height: 1rem;
  max-width: none;
  margin: 0.2rem 0 0;
  padding: 0;
  flex: 0 0 1rem;
  border: 0;
  box-shadow: none;
  accent-color: var(--c-primary);
}

.disk-load-import-preview__toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1 1 auto;
}

.disk-load-import-preview__toggle-text strong {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--c-text);
  letter-spacing: 0;
}

.disk-load-import-preview__toggle-hint {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--c-text-2);
  line-height: 1.4;
}

.disk-load-import-preview__check-col input[type='checkbox'] {
  width: 1rem;
  height: 1rem;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: var(--c-primary);
}

.disk-load-import-preview__hints {
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.75rem;
  color: var(--c-text-2);
}

.disk-load-import-preview__hints li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.disk-load-import-preview__legend {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.disk-load-import-preview__legend--header {
  background: color-mix(in srgb, var(--c-accent, #2563eb) 35%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-accent, #2563eb) 50%, transparent);
}

.disk-load-import-preview__legend--cutoff {
  background: color-mix(in srgb, var(--c-primary) 35%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-primary) 45%, transparent);
}

.disk-load-import-preview__row-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--c-primary);
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.disk-load-import-preview__row-btn:hover:not(:disabled) {
  color: var(--c-text);
}

.disk-load-import-preview__row-btn--cutoff {
  font-weight: 700;
  text-decoration: none;
  background: var(--c-primary-bg);
  border-radius: 4px;
  padding: 0 0.2rem;
}

.disk-load-import-preview__advanced {
  margin: 0.5rem 0 0.85rem;
  font-size: 0.8125rem;
}

.disk-load-import-preview__advanced summary {
  cursor: pointer;
  color: var(--c-text-2);
  user-select: none;
}

.disk-load-import-preview__advanced[open] summary {
  margin-bottom: 0.55rem;
  color: var(--c-text);
}

.disk-load-import-preview__row--cutoff td {
  border-bottom: 2px solid color-mix(in srgb, var(--c-primary) 55%, transparent);
}

.disk-load-table-menu {
  max-width: min(26rem, calc(100vw - 2rem));
  box-sizing: border-box;
  overflow: hidden;
}

.disk-load-import-preview__controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.disk-load-import-preview__controls--sheet-only {
  grid-template-columns: 1fr;
}

.disk-load-import-preview__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8125rem;
  min-width: 0;
}

.disk-load-import-preview__field select {
  width: 100%;
  max-width: none;
  min-height: 2rem;
  padding: 0.25rem 0.5rem;
  margin: 0;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: var(--c-bg, #fff);
  color: var(--c-text);
  box-sizing: border-box;
}

.disk-load-import-preview__field input[type='number'] {
  width: 100%;
  min-height: 2rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  font-size: 0.875rem;
  background: var(--c-bg, #fff);
  color: var(--c-text);
  box-sizing: border-box;
}

.disk-load-import-preview__meta {
  margin: 0.65rem 0 0.4rem;
  font-size: 0.75rem;
}

.disk-load-import-preview__table-wrap {
  overflow: auto;
  max-height: 220px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
}

.disk-load-import-preview__table-wrap--raw {
  max-height: 260px;
}

.disk-load-import-preview__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.disk-load-import-preview__table th,
.disk-load-import-preview__table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.disk-load-import-preview__table th {
  background: color-mix(in srgb, var(--c-border) 35%, transparent);
  font-weight: 600;
}

.disk-load-import-preview__check-col,
.disk-load-import-preview__num-col {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 2.5rem;
  max-width: 2.5rem;
  text-align: center;
  background: var(--c-bg, #fff);
}

.disk-load-import-preview__num-col {
  left: 2.5rem;
  width: 2.25rem;
  max-width: 2.25rem;
  color: var(--c-muted, #666);
  font-variant-numeric: tabular-nums;
}

.disk-load-import-preview__table thead .disk-load-import-preview__check-col,
.disk-load-import-preview__table thead .disk-load-import-preview__num-col {
  background: color-mix(in srgb, var(--c-border) 35%, transparent);
  z-index: 2;
}

.disk-load-import-preview__row--header td {
  background: color-mix(in srgb, var(--c-accent, #2563eb) 12%, transparent);
}

.disk-load-import-preview__row--header .disk-load-import-preview__check-col,
.disk-load-import-preview__row--header .disk-load-import-preview__num-col {
  background: color-mix(in srgb, var(--c-accent, #2563eb) 12%, var(--c-bg, #fff));
}

.disk-load-import-preview__row--preamble td {
  opacity: 0.72;
}

.disk-load-import-preview__row--data td {
  background: color-mix(in srgb, var(--c-primary-bg) 40%, transparent);
}

.disk-load-import-preview__row--excluded td {
  opacity: 0.42;
}

@media (max-width: 560px) {
  .disk-load-import-preview__controls {
    grid-template-columns: 1fr;
  }
}

.sheet-save-choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  min-width: 0;
}

.sheet-save-choice-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-bg);
  color: var(--c-text);
  cursor: pointer;
  font: inherit;
  overflow: hidden;
}

.sheet-save-choice-option:hover:not(:disabled) {
  border-color: var(--c-primary-border);
  background: var(--c-primary-bg);
}

.sheet-save-choice-option:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sheet-save-choice-option__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  color: var(--c-primary);
  border: 1px solid var(--c-border);
}

.sheet-save-choice-option__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 auto;
  min-width: 0;
}

.sheet-save-choice-option__title {
  font-size: 0.875rem;
  font-weight: 600;
}

.sheet-save-choice-option__desc {
  font-size: 0.75rem;
  color: var(--c-text-2);
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pivot-create-dialog {
  width: min(640px, calc(100vw - 2rem));
  max-height: min(82vh, 740px);
  overflow: auto;
}

.pivot-create-dialog__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.75rem;
  min-width: 0;
}

.pivot-create-dialog__col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  max-height: 22rem;
  overflow: auto;
}

.pivot-create-dialog__label {
  margin: 0.4rem 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-2);
}

.pivot-create-dialog__label:first-child {
  margin-top: 0;
}

.pivot-create-dialog__table-hint {
  font-weight: 400;
  color: var(--c-text-2);
}

.pivot-create-dialog__fields-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.pivot-create-dialog__table-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0.55rem 0 0.15rem;
  padding: 0.28rem 0.1rem 0.2rem;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--c-text);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}

.pivot-create-dialog__fields-group:first-child .pivot-create-dialog__table-heading {
  margin-top: 0;
}

.column-dropdown-dialog__search {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0 0 0.45rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.8125rem;
}

.related-fill-dialog__picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.related-fill-dialog__pick {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.related-fill-dialog__pick select {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: 0.8125rem;
  box-sizing: border-box;
}

.related-fill-dialog__found {
  margin-top: 0.65rem;
}

.pivot-sku-picker {
  position: fixed;
  z-index: 10050;
  box-sizing: border-box;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  max-height: 20rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  overscroll-behavior: contain;
  font-size: 0.8125rem;
}

.pivot-sku-picker__search {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-bottom: 1px solid var(--c-border);
  border-radius: 0;
  font: inherit;
  font-size: 0.8125rem;
  flex: none;
  align-self: stretch;
}

.pivot-sku-picker__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.25rem 0;
}

.pivot-sku-picker__count {
  flex: none;
  padding: 0.2rem 0.65rem 0.35rem;
  font-size: 0.75rem;
  color: var(--c-text-2);
}

.pivot-sku-picker__empty {
  flex: none;
  padding: 0.4rem 0.65rem 0.55rem;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--c-text-2);
}

.pivot-sku-picker__option {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 0.4rem 0.65rem;
  border: 0;
  background: transparent;
  color: var(--c-text);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.pivot-sku-picker__option-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.3;
}

.pivot-sku-picker__option-title--expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.pivot-sku-picker__option-more {
  display: inline-block;
  margin: 0.15rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-primary);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.pivot-sku-picker__option-more:hover {
  text-decoration: underline;
}

.pivot-sku-picker__option-sku {
  display: block;
  font-size: 0.75rem;
  color: var(--c-text-2);
}

.pivot-sku-picker__option:hover {
  background: var(--c-primary-bg);
}

.pivot-sku-picker__option.pivot-sku-picker__option--current {
  background: #ececec;
}

.cell-link-dialog__modes {
  display: flex;
  gap: 0.4rem;
  margin: 0.65rem 0 0.75rem;
}

.clear-period-card.column-setup-dialog.pivot-create-dialog {
  display: flex;
  flex-direction: column;
  width: min(36rem, calc(100vw - 2.5rem));
  max-width: min(36rem, calc(100vw - 2.5rem));
  height: auto;
  max-height: min(90vh, calc(100vh - 2.5rem));
  overflow: hidden;
  box-sizing: border-box;
  padding: 1.15rem 1.25rem 1.1rem;
}

.clear-period-card.column-setup-dialog.pivot-create-dialog.column-setup-dialog--picker {
  width: min(88rem, calc(100vw - 2.5rem));
  max-width: min(88rem, calc(100vw - 2.5rem));
}

.column-setup-dialog .constructor-folder-modal__form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0.7rem;
  margin-top: 0.75rem;
  /* Страховка: если контент (превью, сопоставление ключей, кнопки) не влезает
     в max-height карточки — скроллим форму целиком, а не обрезаем содержимое. */
  overflow-y: auto;
  overflow-x: hidden;
}

.column-setup-dialog__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem;
  flex: none;
}

.column-setup-dialog .constructor-folder-modal__field input,
.column-setup-dialog .constructor-folder-modal__select {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.column-setup-dialog__grid {
  flex: 1 1 26rem;
  min-height: 16rem;
  margin-top: 0;
  align-items: stretch;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1rem;
}

/* Обе панели уже свернуты в карточки «Выбрано» — им не нужна высота под скролл списка,
   иначе под карточками остаётся пустое место, из-за которого не видно блока ниже.
   align-items остаётся stretch (как в базовом .column-setup-dialog__grid), чтобы обе
   карточки были одной высоты — по высоте самой высокой из двух (а не жёстких 16rem). */
.column-setup-dialog__grid--compact {
  flex: 0 0 auto;
  min-height: 0;
}

.column-setup-dialog__pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: hidden;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.7rem 0.5rem;
  background: var(--c-bg);
  box-sizing: border-box;
}

.column-setup-dialog__pane .pivot-create-dialog__label {
  margin: 0 0 0.4rem;
}

.column-setup-dialog__pane .column-dropdown-dialog__search {
  margin-bottom: 0.4rem;
  flex: none;
}

.column-setup-dialog__crumb {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.1rem;
  min-height: 1.35rem;
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  color: var(--c-text-2);
  overflow-x: auto;
  overflow-y: hidden;
}

.column-setup-dialog__crumb-seg {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  min-width: 0;
  flex: none;
}

.column-setup-dialog__crumb-btn {
  margin: 0;
  padding: 0.05rem 0.2rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-setup-dialog__crumb-btn:hover:not(:disabled) {
  color: var(--c-text);
  text-decoration: underline;
}

.column-setup-dialog__crumb-btn:disabled {
  cursor: default;
  opacity: 1;
  color: var(--c-text);
}

.column-setup-dialog__pane-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.column-setup-dialog__pane-list .constructor-folder-modal__hint {
  margin: 0.4rem 0.2rem;
}

.column-setup-dialog__pick {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-text);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.column-setup-dialog__pick:hover:not(:disabled) {
  background: var(--c-primary-bg);
}

.column-setup-dialog__pick--selected,
.column-setup-dialog__pick--selected:hover:not(:disabled) {
  background: transparent;
}

.column-setup-dialog__pick-icon {
  display: inline-flex;
  flex: none;
  margin-top: 0.1rem;
  color: var(--c-text-2);
}

.column-setup-dialog__pick-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.column-setup-dialog__pick-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.3;
}

.column-setup-dialog__pick-path {
  font-size: 0.75rem;
  color: var(--c-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-setup-dialog__pick-check {
  flex: none;
  margin-top: 0.15rem;
  color: var(--c-primary);
}

.column-setup-dialog__pick-chevron {
  flex: none;
  margin-top: 0.15rem;
  color: var(--c-text-3);
}

.column-setup-dialog__selected {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: transparent;
  box-sizing: border-box;
  /* Карточка таблицы (с путём на диске) и карточка столбца (без пути) должны
     смотреться одинаково рядом друг с другом: тянемся на всю высоту панели
     (панель уже растянута до высоты соседней по align-items: stretch у грида). */
  flex: 1 1 auto;
  min-height: 3.7rem;
}

.column-setup-dialog__selected-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  margin-top: 0.2rem;
  color: var(--c-primary);
}

.column-setup-dialog__selected-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  gap: 0.1rem;
}

.column-setup-dialog__selected-caption {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--c-text-2);
}

.column-setup-dialog__selected-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.column-setup-dialog__selected-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  word-break: break-word;
  font-weight: 600;
  line-height: 1.3;
}

.column-setup-dialog__selected-name--expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.column-setup-dialog__selected-more {
  align-self: flex-start;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-primary);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.column-setup-dialog__selected-more:hover {
  text-decoration: underline;
}

.column-setup-dialog__selected-path {
  font-size: 0.75rem;
  color: var(--c-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-setup-dialog__selected-change {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: none;
  margin: 0;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--c-primary);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--c-primary);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.column-setup-dialog__selected-change:hover:not(:disabled) {
  background: var(--c-primary-bg);
}

.column-setup-dialog__selected-change:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.column-setup-dialog__preview {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: none;
  min-height: 0;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--c-text-2);
}

.column-setup-dialog__preview-line {
  flex: none;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-setup-dialog__preview-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 11.2rem;
  overflow: auto;
}

.column-setup-dialog__preview-list li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.08rem 0;
}

.column-setup-dialog__preview-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 0.85rem;
}

.column-setup-dialog__preview-more {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-primary);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.4;
  cursor: pointer;
}

.column-setup-dialog__preview-more:hover:not(:disabled) {
  text-decoration: underline;
}

.column-setup-dialog__preview-more:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.column-setup-dialog__actions {
  flex: none;
  margin-top: 0.15rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--c-border);
}

.column-setup-dialog__keys {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: none;
}

.column-setup-dialog__keys-hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--c-text-2);
}

.column-setup-dialog__key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.65rem;
  /* start, а не end: у полей разная высота (превью значений есть не всегда),
     end-выравнивание сбивало select-ы «Этот лист»/«Источник» по вертикали. */
  align-items: start;
  /* Та же карточная рамка, что у «Таблица с данными» / «Столбец со значением» —
     иначе ряд сопоставления смотрится случайной вставкой посреди диалога. */
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg);
  box-sizing: border-box;
}

.column-setup-dialog__key-row .constructor-folder-modal__field {
  margin: 0;
}

.column-setup-dialog__key-sample {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--c-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-setup-dialog__key-remove,
.column-setup-dialog__key-remove-spacer {
  min-width: 4.5rem;
  /* Отступ под высоту подписи поля, чтобы кнопка легла на уровень select-ов,
     а не «прилипала» к верху ряда после смены align-items на start. */
  margin-top: 1.35rem;
}

.column-setup-dialog__key-remove {
  height: 2.15rem;
  padding: 0 0.55rem;
  border: 0;
  background: none;
  color: var(--c-text-2);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.column-setup-dialog__key-remove:hover:not(:disabled) {
  color: var(--c-text);
  text-decoration: underline;
}

.column-setup-dialog__key-remove:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sheet-cell-link-chip {
  position: fixed;
  z-index: 10040;
  box-sizing: border-box;
  min-width: 11.5rem;
  max-width: 18rem;
  padding: 0.45rem 0.6rem 0.5rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
}

.sheet-cell-link-chip__hint {
  margin: 0 0 0.15rem;
  font-size: 0.6875rem;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--c-text-3);
}

.sheet-cell-link-chip__open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.2rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--c-text);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.35;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--c-border-strong);
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.sheet-cell-link-chip__open:hover,
.sheet-cell-link-chip__open:focus-visible {
  color: var(--c-text);
  background: transparent;
  text-decoration-color: var(--c-text-2);
}

.deleted-columns-panel__list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  max-height: 16rem;
  overflow: auto;
}

.deleted-columns-panel__item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--c-border);
}

.deleted-columns-panel__item:last-child {
  border-bottom: 0;
}

.deleted-columns-panel__title {
  font-size: 0.875rem;
  font-weight: 600;
}

.deleted-columns-panel__meta {
  font-size: 0.75rem;
  color: var(--c-text-2);
}

@media (max-width: 640px) {
  .pivot-create-dialog__grid {
    grid-template-columns: 1fr;
  }

  .related-fill-dialog__picks {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .clear-period-card.column-setup-dialog.pivot-create-dialog.column-setup-dialog--picker {
    width: min(72rem, calc(100vw - 1.5rem));
    max-width: min(72rem, calc(100vw - 1.5rem));
  }

  .column-setup-dialog__top,
  .column-setup-dialog__grid {
    grid-template-columns: 1fr;
  }

  .column-setup-dialog__grid {
    flex: 1 1 auto;
    overflow: auto;
  }

  .column-setup-dialog__pane {
    min-height: 16rem;
  }

  .column-setup-dialog__key-row {
    grid-template-columns: 1fr;
  }

  .column-setup-dialog__preview-line {
    white-space: normal;
  }
}

.sheet-ops-terminal {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  margin: 0;
  height: var(--terminal-panel-height, 200px);
  background: #111827;
  color: #e5e7eb;
  border-radius: 0;
  border: 1px solid #1f2937;
  border-top: none;
  border-bottom: none;
  overflow: hidden;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.sheet-ops-terminal__resize {
  height: 8px;
  cursor: ns-resize;
  background: linear-gradient(to bottom, #374151, #1f2937);
  flex-shrink: 0;
  border-bottom: 1px solid #111827;
}

.sheet-ops-terminal__resize:hover,
.sheet-ops-terminal__resize:active {
  background: var(--c-primary);
}

.sheet-ops-terminal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid #1f2937;
  background: #0b1220;
  flex-shrink: 0;
}

.sheet-ops-terminal__sheet-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  flex: 1 1 auto;
  min-width: 0;
}

.sheet-ops-terminal__sheet-tab {
  min-height: 1.4rem;
  padding: 0.1rem 0.45rem;
  border: 1px solid #374151;
  border-radius: 4px;
  background: transparent;
  color: #9ca3af;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.6875rem;
  cursor: pointer;
}

.sheet-ops-terminal__sheet-tab:hover {
  color: #fff;
  border-color: #4b5563;
}

.sheet-ops-terminal__sheet-tab.is-active {
  background: #1f2937;
  color: #fff;
  border-color: #6b7280;
}

.sheet-ops-terminal__title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: #f3f4f6;
}

.sheet-ops-terminal__actions {
  display: flex;
  gap: 0.35rem;
}

.sheet-ops-terminal__btn {
  appearance: none;
  border: 1px solid #374151;
  background: transparent;
  color: #9ca3af;
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.6875rem;
  cursor: pointer;
}

.sheet-ops-terminal__btn:hover {
  color: #fff;
  border-color: #6b7280;
}

.sheet-ops-terminal__log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.65rem 0.75rem 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.55;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sheet-ops-terminal__log .ts {
  color: #9ca3af;
}
.sheet-ops-terminal__log .ok {
  color: #4ade80;
}
.sheet-ops-terminal__log .info {
  color: #a78bfa;
}
.sheet-ops-terminal__log .muted {
  color: #9ca3af;
}
.sheet-ops-terminal__log .warn {
  color: #fbbf24;
}

.sheet-ops-terminal__log .json {
  display: block;
  margin: 0.2rem 0 0.55rem 0;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: #0b1220;
  border: 1px solid #1f2937;
  color: #d1d5db;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.6875rem;
  line-height: 1.45;
}

.disk-api-method-picker {
  max-width: 28rem;
}

.disk-api-method-picker__hint {
  margin: 0 0 0.85rem;
  font-size: 0.875rem;
}

.disk-api-method-picker__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.disk-api-method-picker__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--c-border, #e5e7eb);
  border-radius: 0.65rem;
  background: var(--c-surface, #fff);
  box-shadow: none;
  text-align: left;
  cursor: pointer;
  min-height: 0;
}

.disk-api-method-picker__item:hover:not(:disabled) {
  background: color-mix(in srgb, var(--c-border) 22%, var(--c-surface, #fff));
  border-color: var(--c-border-strong, #d1d5db);
}

.disk-api-method-picker__item:focus,
.disk-api-method-picker__item:focus-visible,
.disk-api-method-picker__item:active {
  outline: none;
  box-shadow: none;
}

.disk-api-method-picker__icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--c-text-2, #64748b);
}

.disk-api-method-picker__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.disk-api-method-picker__label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--c-text);
}

.disk-api-method-picker__desc {
  font-size: 0.8125rem;
  line-height: 1.35;
}

.disk-api-sheet__load-hint {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
}

.disk-api-sheet__canvas {
  min-height: 0;
  overflow: auto;
}

.disk-api-sheet__canvas .manual-table-editor,
.disk-api-sheet__canvas .sheet-layout {
  min-height: 100%;
}

.fortune-sheet-grid-embed {
  flex: 1;
  min-height: 420px;
  height: min(70vh, 900px);
  display: flex;
  flex-direction: column;
}

.fortune-sheet-grid-embed .sheet-grid-host,
.table-runtime__data .fortune-sheet-grid-embed {
  flex: 1;
  min-height: 0;
}

.sheet-grid-host {
  position: relative;
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  --dp-outline-content-left: 0px;
}

.sheet-grid-host > .sheet-grid-host__canvas {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.sheet-grid-host > [data-dp-overlay] {
  flex: none !important;
  display: block !important;
  min-height: 0 !important;
  pointer-events: none !important;
}

/* width/height: auto !important схлопывает оверлеи, у которых все дети
   position:absolute (номера строк). Им нужна инлайн-ширина из measure. */
.sheet-grid-host > [data-dp-overlay]:not(.disk-file-row-header-overlay):not(.row-group-overlay) {
  width: auto !important;
  height: auto !important;
}

.sheet-grid-host > .pivot-sku-picker {
  flex: none;
  display: flex;
  height: auto;
  min-height: 0;
  pointer-events: auto;
}

.sheet-grid-host > .sheet-column-filter-overlay,
.sheet-grid-host > .sheet-find-hits-overlay,
.sheet-grid-host > .sheet-column-name-overlay {
  flex: none;
  display: block;
  width: auto;
  height: auto;
  min-height: 0;
}

.sheet-grid-host > .disk-file-row-header-overlay {
  position: absolute;
  z-index: 1009;
  flex: none;
  display: block;
  min-height: 0;
  overflow: hidden;
  background: transparent;
  touch-action: none;
  pointer-events: none;
}

/* Обёртка полос раздела: не должна попадать под `.sheet-grid-host > div`
   (column + flex:1), иначе шапка растягивается на всю сетку. */
.sheet-grid-host > .disk-file-row-section-layer {
  position: absolute;
  inset: 0;
  z-index: 1007;
  flex: none;
  display: block;
  width: auto;
  height: auto;
  min-height: 0;
  overflow: visible;
  pointer-events: none;
}

.disk-file-row-header-overlay__index {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: #fff;
  color: #5e5e5e;
  font: 400 13px Arial, Helvetica, sans-serif;
  border-right: 1px solid #c5d0dc;
  border-bottom: 1px solid #dbe3ec;
  pointer-events: none;
  z-index: 1;
}

.disk-file-row-header-overlay__index--shifted {
  right: auto;
  padding: 0;
  border: none;
  background: #fff !important;
  color: #000;
  z-index: 5;
  overflow: hidden;
}

/* Р1 в той же колонке, что H1/H2: серая ячейка + вертикальная и горизонтальная линии. */
.disk-file-row-header-overlay__section-toggle {
  position: absolute;
  left: var(--dp-outline-content-left, 18px);
  right: 0;
  z-index: 4;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-sizing: border-box;
  min-height: 0 !important;
  margin: 0;
  padding: 0 !important;
  border: none;
  border-right: 1px solid #c5d0dc;
  border-bottom: 1px solid #dbe3ec;
  border-radius: 0;
  outline: none;
  background: #eef2f7;
  box-shadow: none;
  color: #64748b;
  font: 700 11px Arial, Helvetica, sans-serif;
  letter-spacing: normal;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
}

.disk-file-row-header-overlay__section-toggle:hover:not(:disabled) {
  background: color-mix(in srgb, var(--c-primary, #7c3aed) 10%, #eef2f7);
  border-color: #c5d0dc;
  color: var(--c-primary, #7c3aed);
}

.disk-file-row-header-overlay__section-toggle--virtual {
  position: absolute;
  z-index: 1008;
  pointer-events: auto;
  border-bottom: none;
  box-sizing: border-box;
}

.disk-file-row-header-overlay__section-badge,
.disk-file-row-header-overlay__section-chevron {
  flex: 0 0 auto;
  pointer-events: none;
}

.disk-file-row-header-overlay__section-chevron {
  font-size: 9px;
}

.disk-file-row-header-overlay__drag {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  pointer-events: auto;
  touch-action: none;
}

.disk-file-row-header-overlay--enabled .disk-file-row-header-overlay__drag {
  cursor: default;
}

.disk-file-row-header-overlay__resize {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 6;
  box-sizing: border-box;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: ns-resize;
  pointer-events: auto;
  touch-action: none;
}

.disk-file-row-header-overlay__resize:hover {
  background: color-mix(in srgb, var(--c-primary, #7c3aed) 40%, transparent);
}

body.sheet-grid-resizing-row,
body.sheet-grid-resizing-row * {
  cursor: ns-resize !important;
  user-select: none !important;
}

.sheet-grid-host > .sheet-reorder-highlight {
  position: absolute;
  inset: 0;
  z-index: 1005;
  flex: none;
  display: block;
  pointer-events: none;
  overflow: hidden;
}

.sheet-reorder-highlight > .sheet-column-selection-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sheet-column-selection-overlay__band {
  position: absolute;
  pointer-events: none;
  box-sizing: border-box;
  background: color-mix(in srgb, var(--c-primary, #7C3AED) 10%, transparent);
}

.sheet-reorder-highlight__band {
  position: absolute;
  pointer-events: none;
  box-sizing: border-box;
  background: color-mix(in srgb, var(--c-primary, #7C3AED) 10%, transparent);
  box-shadow: none;
}

.sheet-reorder-highlight__insert {
  position: absolute;
  pointer-events: none;
  background: var(--c-primary, #7C3AED);
  z-index: 1;
}

.sheet-reorder-highlight__insert--col {
  width: 3px;
  margin-left: -1px;
}

.sheet-reorder-highlight__insert--row {
  height: 3px;
  margin-top: -1px;
}

.disk-file-row-header-overlay__selected {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  /* Фон как раньше на всю клетку гуттера; цифра — в зоне справа от −/+. */
  padding-left: var(--dp-outline-content-left, 0px);
  background: var(--c-primary, #7C3AED);
  color: #fff;
  font: 600 13px Arial, Helvetica, sans-serif;
  line-height: 1;
  border-right: 1px solid var(--c-primary-h, #6D28D9);
  border-bottom: 1px solid var(--c-primary-h, #6D28D9);
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.disk-file-row-header-overlay--enabled {
  cursor: default;
}

.disk-file-row-header-overlay__target {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  pointer-events: none;
  background: var(--c-primary, #2563eb);
  box-shadow: none;
}

.sheet-grid-host .fortune-container {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet-grid-host .fortune-workarea {
  flex: 0 0 auto;
  position: relative;
  z-index: 8;
}

/*
  Fortune кладёт h-scrollbar поверх нижней строки (не вычитает его из cellmainHeight).
  Spacer 10px укорачивает placeholder → Fortune меряет меньший clientHeight;
  полосу якорим в зазор (как вертикальная, 10px) через installFortuneHorizontalScrollbarGap.
*/
.sheet-grid-host .fortune-sheet-row-wrapper {
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
}

.sheet-grid-host .fortune-sheet-container {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  overscroll-behavior: contain;
}

.sheet-grid-host .fortune-sheet-row-wrapper > .fortune-sheet-container {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  min-height: 0;
}

.sheet-grid-host .fortune-sheet-canvas-placeholder {
  flex: 1 1 auto;
  min-height: 0 !important;
  width: 100%;
  height: auto !important;
  margin: 0 !important;
}

/* Зазор под сеткой для горизонтального скроллбара (как ширина вертикального). */
.sheet-grid-host .fortune-sheet-container::after {
  content: '';
  flex: 0 0 10px;
  pointer-events: none;
}

.sheet-grid-host .fortune-sheet-canvas {
  position: absolute;
  top: 0;
  left: 0;
  /* width/height задаёт Fortune из placeholder */
}

.sheet-grid-host .fortune-row-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

.sheet-grid-host .fortune-sheet-overlay {
  position: absolute;
  top: 0;
  left: 0;
  /* visible: h-scrollbar в зазоре под placeholder; hidden его срезает. */
  overflow: visible !important;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.sheet-grid-host .fortune-col-header-wrap {
  flex-shrink: 0;
}

.sheet-grid-host .luckysheet-sheet-area {
  display: flex;
  flex-direction: row;
  flex: 0 0 31px;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
  align-items: center;
  gap: 0.35rem;
}

.sheet-grid-host .luckysheet-sheet-area #luckysheet-sheet-content {
  flex: 1 1 auto;
  min-width: 0;
}

.sheet-grid-host .fortune-sheet-area-right,
.sheet-grid-host .fortune-zoom-container {
  display: flex;
  align-items: center;
  height: 31px;
}

.sheet-grid-host .luckysheet-scrollbar-x.luckysheet-scrollbar-ltr {
  /* Тонкая полоса 10px — как вертикальная (без серой «полки»). */
  bottom: 0 !important;
  top: auto !important;
  transform: none !important;
  z-index: 1008 !important;
  height: 10px !important;
  min-height: 10px !important;
  box-sizing: border-box;
  border: none !important;
  background: transparent !important;
  overflow-x: scroll !important;
  overflow-y: hidden !important;
  pointer-events: auto;
  opacity: 1 !important;
  visibility: visible !important;
}

.sheet-grid-host .luckysheet-scrollbar-y {
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  z-index: 1009 !important;
  width: 10px !important;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  pointer-events: auto;
  background: transparent !important;
}

.sheet-grid-host .fortune-left-top {
  background-color: #e8eef5 !important;
  border-right: 1px solid #c5d0dc !important;
  border-bottom: 1px solid #c5d0dc !important;
  box-sizing: border-box;
}

.sheet-grid-host .header-arrow,
.sheet-grid-host .fortune-col-header .header-arrow,
.sheet-grid-host .fortune-col-header [class*='header-arrow'] {
  display: none !important;
}

.sheet-grid-host .fortune-context-menu,
.sheet-grid-host .fortune-filter-menu {
  position: fixed !important;
  z-index: 10050 !important;
  width: max-content !important;
  max-width: min(28rem, calc(100vw - 16px)) !important;
  max-height: min(72vh, calc(100dvh - 16px)) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  /* Скрыть до первой стабильной позиции — без «прыжка» из координат Fortune. */
  visibility: hidden;
}

.sheet-grid-host .fortune-context-menu[data-dp-menu-placed='1'],
.sheet-grid-host .fortune-filter-menu[data-dp-menu-placed='1'] {
  visibility: visible;
}

/* ПКМ шапки столбца — плотность и 13px как в Google Таблицах */
.fortune-context-menu[data-dp-column-header-menu='1'] {
  min-width: 17.5rem;
  padding: 6px 0 !important;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px !important;
  line-height: 20px;
  color: #202124;
  border: 1px solid #dadce0;
  border-radius: 4px;
  box-shadow: 0 2px 6px 2px rgba(60, 64, 67, 0.15);
  overflow: visible !important;
  max-height: none !important;
}

.fortune-context-menu[data-dp-overlay-column-menu='1'],
.fortune-context-menu[data-dp-overlay-row-menu='1'] {
  position: fixed;
  z-index: 10052;
  background: #fff;
  visibility: visible;
  overflow: visible !important;
  max-height: none !important;
  max-width: min(28rem, calc(100vw - 16px));
  width: max-content;
}

.fortune-context-menu[data-dp-overlay-column-menu='1'] .luckysheet-cols-menuitem,
.fortune-context-menu[data-dp-overlay-row-menu='1'] .luckysheet-cols-menuitem {
  cursor: pointer;
  user-select: none;
}

.fortune-context-menu[data-dp-overlay-column-menu='1'] .luckysheet-cols-menuitem:hover,
.fortune-context-menu[data-dp-overlay-row-menu='1'] .luckysheet-cols-menuitem:hover {
  background: #f1f3f4;
}

.fortune-context-menu .luckysheet-cols-menuitem.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.fortune-context-menu[data-dp-overlay-column-menu='1'] .luckysheet-cols-menuitem.is-disabled:hover,
.fortune-context-menu[data-dp-overlay-row-menu='1'] .luckysheet-cols-menuitem.is-disabled:hover {
  background: transparent;
}

.fortune-context-menu[data-dp-column-header-menu='1'] .luckysheet-cols-menuitem {
  min-height: 32px;
  padding: 0 !important;
  font-size: 13px !important;
}

.fortune-context-menu[data-dp-column-header-menu='1'] .luckysheet-cols-menuitem-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 32px;
  padding: 0 16px 0 12px !important;
  font-size: 13px !important;
  font-family: Arial, Helvetica, sans-serif;
  color: #202124;
  box-sizing: border-box;
}

.fortune-context-menu[data-dp-column-header-menu='1'] .dp-col-menu-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: #5f6368;
}

.fortune-context-menu[data-dp-column-header-menu='1'] .dp-col-menu-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  line-height: 20px;
}

.fortune-context-menu[data-dp-column-header-menu='1'] .dp-col-menu-shortcut {
  flex: 0 0 auto;
  margin-left: 20px;
  color: #80868b;
  font-size: 13px;
  line-height: 20px;
}

.fortune-context-menu[data-dp-column-header-menu='1'] .dp-col-menu-count {
  width: 2rem;
  height: 22px;
  margin: 0;
  padding: 0 4px;
  border: 1px solid #dadce0;
  border-radius: 2px;
  font-size: 13px;
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
  color: #202124;
}

.fortune-context-menu[data-dp-column-header-menu='1'] .dp-col-menu-divider,
.fortune-context-menu[data-dp-column-header-menu='1'] .fortune-context-menu-divider.dp-col-menu-divider {
  display: block !important;
  height: 1px;
  margin: 6px 0;
  background: #e8eaed;
  border: 0;
}

/* Меню вкладки листа (ПКМ внизу): подменю «Изменить цвет» не обрезать */
.sheet-grid-host .fortune-context-menu.luckysheet-cols-menu[data-dp-sheet-tab-menu='1'] {
  overflow: visible !important;
  max-height: none !important;
}

.sheet-grid-host #fortune-change-color {
  position: fixed !important;
  bottom: auto !important;
  z-index: 10051 !important;
}

/*
  Условное форматирование: Fortune даёт подменю 150px, русские подписи
  («Дублирующееся значение») наезжают на пример справа (##, Вчера).
*/
.sheet-grid-host .fortune-toolbar-select:has(.condition-format-sub-menu) {
  overflow: visible;
}

.sheet-grid-host .condition-format-sub-menu {
  min-width: 15.5rem;
  max-width: min(22rem, calc(100vw - 24px));
}

.sheet-grid-host .condition-format-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  white-space: nowrap;
  padding: 6px 14px;
}

.sheet-grid-host .condition-format-item > span {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 0.35rem;
}

/* Модалка вставки/переименования выше меню Fortune — иначе пункт меню остаётся поверх диалога. */
body:has(.clear-period-modal) .fortune-context-menu,
body:has(.clear-period-modal) .fortune-filter-menu {
  display: none !important;
}

/* Полоса «добавить N строк» Fortune — скрываем: у API она даёт пустую прокрутку, у ручных — свой футер. */
.sheet-grid-host .luckysheet-bottom-controll-row,
.sheet-grid-host #luckysheet-bottom-add-row,
.sheet-grid-host #luckysheet-bottom-add-row-input,
.sheet-grid-host #luckysheet-bottom-return-top {
  display: none !important;
}

.sheet-add-rows-slot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 42%;
  z-index: 4;
}

.sheet-add-rows-bar {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.2rem;
  margin: 0;
  padding: 0 0.15rem;
  border: none;
  background: transparent;
  color: #5f6368;
  font-size: 12px;
  line-height: 1;
  font-family: Arial, Helvetica, sans-serif;
  white-space: nowrap;
}

.sheet-add-rows-bar__action {
  padding: 0;
  border: none;
  background: none;
  color: #1a73e8;
  font: inherit;
  cursor: pointer;
}

.sheet-add-rows-bar__action:hover:not(:disabled) {
  text-decoration: underline;
}

.sheet-add-rows-bar__action:disabled {
  opacity: 0.55;
  cursor: default;
}

.sheet-add-rows-bar__count {
  flex: 0 0 2.6rem;
  width: 2.6rem;
  max-width: 2.6rem;
  height: 18px;
  padding: 0 2px;
  margin: 0;
  border: 1px solid #80868b;
  border-radius: 2px;
  background: #fff;
  color: #3c4043;
  font: inherit;
  font-size: 12px;
  text-align: center;
  appearance: textfield;
}

.sheet-add-rows-bar__count::-webkit-outer-spin-button,
.sheet-add-rows-bar__count::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.sheet-add-rows-bar__count:focus {
  outline: 2px solid #1a73e8;
  outline-offset: 0;
  border-color: #1a73e8;
}

/* Список всех листов (иконка 2×2) — вкладки уже есть, кнопка лишняя */
.sheet-grid-host .sheet-list-container,
.sheet-grid-host .fortune-context-menu.fortune-sheet-list {
  display: none !important;
}

/*
  Fortune рисует автосумму отдельным блоком под вкладками — ставим на одну линию
  с зумом справа (как в оригинале), без обрезки слева у кнопок листов.
*/
.sheet-grid-host .fortune-stat-area {
  position: absolute;
  right: 8.75rem;
  left: auto;
  bottom: 0;
  z-index: 6;
  height: 31px;
  max-width: calc(100% - 10rem);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: transparent;
  pointer-events: auto;
  overflow: visible;
}

.sheet-grid-host .fortune-stat-area .sheet-add-rows-bar {
  padding-right: 0.25rem;
}

/* Встроенная полоса Fortune показывает все метрики сразу — скрываем, свой picker в portal. */
.sheet-grid-host .luckysheet-sheet-selection-calInfo {
  display: none !important;
}

.sheet-grid-host .luckysheet-cell-selected {
  /* Fortune: width/height = cell−1. Рамку рисуем inset (равномерно), а бокс
     добираем padding справа/снизу на 1px — иначе остаётся зазор до линии сетки. */
  box-sizing: content-box;
  border: none !important;
  margin: 0 !important;
  padding: 0 1px 1px 0 !important;
  box-shadow: inset 0 0 0 2px var(--c-primary, #7c3aed) !important;
  background: color-mix(in srgb, var(--c-primary, #7c3aed) 10%, transparent) !important;
  outline: none !important;
}

.sheet-grid-host .luckysheet-cs-inner-border {
  border-width: 0 !important;
}

/* Только заливка активной ячейки — без второй обводки. */
.sheet-grid-host .luckysheet-cell-selected-focus {
  box-sizing: content-box;
  border: none !important;
  margin: 0 !important;
  padding: 0 1px 1px 0 !important;
  background: color-mix(in srgb, var(--c-primary, #7c3aed) 12%, transparent) !important;
  box-shadow: none !important;
  outline: none !important;
  z-index: 16 !important;
}

.sheet-grid-host .luckysheet-cs-fillhandle {
  background-color: var(--c-primary, #7c3aed) !important;
  /* Компенсация padding 1px у родителя — квадрат снова на углу рамки. */
  right: -4px !important;
  bottom: -4px !important;
}

.sheet-grid-host .fortune-col-header-selected,
.sheet-grid-host .fortune-row-header-selected {
  border-color: var(--c-primary, #7c3aed) !important;
  border-width: 1px !important;
  box-shadow: none !important;
}

.sheet-grid-host .fortune-cell-selected-extend,
.sheet-grid-host .fortune-cell-selected-move {
  border-color: var(--c-primary, #7c3aed) !important;
}

.sheet-grid-host .fortune-selection-copy-hc {
  border-color: var(--c-primary, #7c3aed) !important;
}

/* Axis overlay already paints the row/column — hide Fortune’s offset 1px box. */
.sheet-grid-host--axis-highlight .luckysheet-cell-selected,
.sheet-grid-host--axis-highlight .luckysheet-cell-selected-focus {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.sheet-grid-host--axis-highlight .luckysheet-cs-fillhandle {
  visibility: hidden !important;
}

.sheet-grid-host--axis-highlight .fortune-row-header-selected,
.sheet-grid-host--axis-highlight .fortune-col-header-selected {
  display: none !important;
}

.sheet-grid-host--header-cell-focus .luckysheet-cell-selected,
.sheet-grid-host--header-cell-focus .luckysheet-cell-selected-focus,
.sheet-grid-host--header-cell-focus .luckysheet-cs-fillhandle,
.sheet-grid-host--header-cell-focus .fortune-cell-selected,
.sheet-grid-host--header-cell-focus .fortune-cell-selected-focus,
.sheet-grid-host--chrome-row-focus .luckysheet-cell-selected,
.sheet-grid-host--chrome-row-focus .luckysheet-cell-selected-focus,
.sheet-grid-host--chrome-row-focus .luckysheet-cs-fillhandle,
.sheet-grid-host--chrome-row-focus .fortune-cell-selected,
.sheet-grid-host--chrome-row-focus .fortune-cell-selected-focus {
  visibility: hidden !important;
}

/* Пунктир копирования Fortune — не прятать вместе с обычным выделением шапки. */
.sheet-grid-host .fortune-selection-copy,
.sheet-grid-host--header-cell-focus .fortune-selection-copy {
  visibility: visible !important;
}

/* Разделы строк: серая полоса только в области ячеек (название). Р1 живёт в гуттере.
   Цвет/бордер — те же, что у собственной шапки колонок (.disk-file-column-header-grid*),
   чтобы полоса раздела визуально читалась как «ещё одна шапка», а не отдельный акцент.
   z-index заметно выше слоя выделения Fortune (luckysheet-cell-selected и т.п. — 14…18),
   иначе клик по полю ввода на миг подсвечивает «родную» ячейку под полосой.
   Нельзя оставлять этот div под общее `.sheet-grid-host > div` (flex-direction: column +
   flex: 1) — иначе Р1/название складываются столбиком по центру, а полоса растягивается
   на всю сетку и выглядит как пустая строка. */
.disk-file-row-section-overlay__bar {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  overflow: hidden;
  background: #eef2f7;
  border-top: 1px solid #c5d0dc;
  border-bottom: 1px solid #c5d0dc;
  z-index: 1007;
  pointer-events: auto;
}

/* После .bar: иначе border-top/bottom шапки рисуются поверх виртуальной полосы. */
.disk-file-row-section-overlay__bar--virtual {
  border: none;
  box-sizing: border-box;
}

.disk-file-row-section-overlay__title-input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  width: auto;
  min-height: 0 !important;
  height: 100% !important;
  max-height: none;
  align-self: stretch;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 0 8px !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  appearance: none;
  background: transparent !important;
  background-color: transparent !important;
  color: var(--c-text, #1f2937);
  font: 600 12px Arial, Helvetica, sans-serif !important;
  line-height: 1.2 !important;
  text-align: left;
  box-shadow: none !important;
  transition: none !important;
  pointer-events: auto;
}

/* Глобальный `input` / `input:focus` (padding, max-width, ореол primary) не должен
   вылезать из строки раздела отдельной тонкой полосой. */
.disk-file-row-section-overlay__title-input:focus {
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.disk-file-row-section-overlay__title-input::placeholder {
  color: var(--c-text-3, #9ca3af);
  font-weight: 500;
}

.disk-file-row-section-overlay__range {
  display: none;
}

.disk-file-row-section-insert-button {
  position: absolute;
  z-index: 1007;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
  background: var(--c-primary, #7c3aed);
  color: #fff;
  font: 600 12px Arial, Helvetica, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
}

.disk-file-row-section-insert-button:hover {
  background: color-mix(in srgb, var(--c-primary, #7c3aed) 88%, black);
}

.disk-file-row-section-menu {
  position: fixed;
  z-index: 1008;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: 4px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e5e5e5;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}

/* Глобальное правило `button {...}` (см. выше) даёт всем кнопкам рамку + тень —
   явно сбрасываем их здесь, иначе каждый пункт меню выглядит отдельной «рамкой». */
.disk-file-row-section-menu button {
  display: block;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 7px 10px;
  border: none;
  outline: none;
  background: transparent;
  box-shadow: none;
  text-align: left;
  font: 400 13px Arial, Helvetica, sans-serif;
  letter-spacing: normal;
  color: #1f2937;
  border-radius: 5px;
  cursor: pointer;
}

.disk-file-row-section-menu button:hover {
  background: color-mix(in srgb, var(--c-primary, #7c3aed) 10%, transparent);
}

.sheet-selection-stat-picker {
  position: relative;
  max-width: min(22rem, calc(100vw - 12rem));
}

.sheet-selection-stat-picker__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  max-width: 100%;
  height: 24px;
  padding: 0 0.65rem 0 0.7rem;
  border: none;
  border-radius: 999px;
  background: var(--c-primary-bg);
  color: var(--c-primary);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.sheet-selection-stat-picker__trigger:hover {
  background: color-mix(in srgb, var(--c-primary-bg) 70%, var(--c-primary-border));
}

.sheet-selection-stat-picker__trigger--static {
  cursor: default;
}

.sheet-selection-stat-picker__trigger--static:hover {
  background: var(--c-primary-bg);
}

.sheet-selection-stat-picker__label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-selection-stat-picker__value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}

.sheet-selection-stat-picker__chevron {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  color: var(--c-primary);
  opacity: 0.9;
}

.sheet-selection-stat-picker__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 10060;
  min-width: 14.5rem;
  padding: 0.35rem 0;
  border: none;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 8px 24px rgba(60, 64, 67, 0.15);
}

.sheet-selection-stat-picker__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  width: 100%;
  padding: 0.42rem 0.9rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #5f6368;
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.sheet-selection-stat-picker__option:hover:not(:disabled) {
  background: #f1f3f4;
  color: #202124;
}

.sheet-selection-stat-picker__option--active {
  background: var(--c-primary-bg);
  color: var(--c-primary);
}

.sheet-selection-stat-picker__option--active:hover:not(:disabled) {
  background: var(--c-primary-bg);
  color: var(--c-primary);
}

.sheet-selection-stat-picker__option:disabled {
  opacity: 0.45;
  cursor: default;
}

.sheet-selection-stat-picker__option strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}

.sheet-selection-stat-picker__option--active strong {
  color: var(--c-text);
}

/* ?????? ?????? FortuneSheet: ?????????? ?? ?????? ? ? ?????????? ???????? */
.sheet-grid-host .fortune-currency-btn--rub {
  position: relative;
}

.sheet-grid-host .fortune-currency-btn--rub > svg {
  opacity: 0;
}

.sheet-grid-host .fortune-currency-btn--rub::before {
  content: "\20BD"; /* ? */
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  color: #525c6f;
  pointer-events: none;
}

/* ── Share-links: анонимный read-only просмотр /s/:token ─────────────────── */
.shared-view-page {
  max-width: 100%;
  padding: 1.5rem 1.75rem 2.5rem;
}

.shared-view-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.shared-view-banner__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.shared-view-banner__expires {
  font-size: 0.8rem;
}

.shared-view-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 220px);
  border: 1px solid var(--c-border);
  border-radius: 8px;
}

.shared-view-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.8125rem;
}

.shared-view-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--c-surface-2, #f4f3f7);
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  padding: 0.5rem 0.65rem;
  font-weight: 600;
  white-space: nowrap;
}

.shared-view-table tbody td {
  padding: 0.4rem 0.65rem;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.shared-view-table tbody tr:hover td {
  background: color-mix(in srgb, var(--c-primary, #7c3aed) 5%, transparent);
}

.shared-view-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

/* ── Диалог «Поделиться» (кнопка тулбара + попап-список ссылок) ──────────── */
.disk-file-share-menu {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  z-index: 2;
}

.disk-file-share-menu--open {
  z-index: 70;
}

.share-link-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1200;
  width: min(24rem, calc(100vw - 1rem));
  padding: 0.75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface);
  box-shadow: var(--shadow-lg);
}

/* Над сайдбаром (shell-nav) и лентой — рендер в document.body */
.share-link-popover--portal {
  position: fixed;
  right: auto;
  z-index: 11000;
}

.share-link-popover__title {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.share-link-popover__hint {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  line-height: 1.4;
}

.share-link-popover__create {
  width: 100%;
}

.share-link-popover__error {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
}

.share-link-popover__tg-hint {
  margin: 0.5rem 0 0;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm, 4px);
  background: color-mix(in srgb, var(--c-primary, #7c3aed) 10%, var(--c-surface, #fff));
  border: 1px solid color-mix(in srgb, var(--c-primary, #7c3aed) 25%, var(--c-border, #e5e7eb));
  color: var(--c-text, #0f172a);
  font-size: 0.75rem;
  line-height: 1.35;
}

.share-link-popover__loading {
  display: flex;
  justify-content: center;
  padding: 0.75rem 0;
}

.share-link-popover__empty {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
}

.share-link-popover__list {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  max-height: 16rem;
  overflow: auto;
}

.share-link-popover__item {
  padding: 0.4rem 0;
  border-top: 1px solid var(--c-border);
}

.share-link-popover__item-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.share-link-popover__url {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.share-link-popover__actions {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.1rem;
}

.share-link-popover__icon-action {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm, 4px);
  background: transparent;
  color: var(--c-text-2, #64748b);
  cursor: pointer;
  line-height: 0;
  text-decoration: none;
}

.share-link-popover__icon-action:hover {
  background: color-mix(in srgb, var(--c-text, #0f172a) 8%, transparent);
  color: var(--c-text, #0f172a);
}

.share-link-popover__icon-action--danger:hover {
  color: var(--c-danger, #dc2626);
  background: color-mix(in srgb, var(--c-danger, #dc2626) 10%, transparent);
}

.share-link-popover__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.15rem;
  font-size: 0.7rem;
}

.shared-view-applied-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 1400;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  background: var(--c-text, #1f2937);
  color: #fff;
  font-size: 0.8125rem;
  box-shadow: var(--shadow-lg);
  animation: shared-view-toast-in 0.2s ease-out;
}

@keyframes shared-view-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* —— Макеты (/mockups) —— */
.mockups-page {
  padding: 1rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  flex: 1;
}

.mockups-page--preview {
  height: 100%;
}

.mockups-page__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.mockups-page__top--preview {
  align-items: center;
}

.mockups-page__title {
  margin: 0;
  font-size: 1.625rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--c-text);
}

.mockups-page__subtitle {
  margin: 0.35rem 0 0;
}

.mockups-page__path {
  margin: 0;
}

.mockups-page__path-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
}

.mockups-preview-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  flex: 1;
  min-width: 0;
}

.mockups-back {
  text-decoration: none;
}

.mockups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}

.mockups-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  border: 1px solid var(--c-border, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  background: var(--c-surface, #fff);
  cursor: pointer;
  overflow: hidden;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mockups-card:hover {
  border-color: var(--c-border-strong, #cbd5e1);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.06));
}

.mockups-card__preview {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg-muted, #f3f4f6);
  color: var(--c-text-muted, #6b7280);
  border-bottom: 1px solid var(--c-border, #e5e7eb);
}

.mockups-card__body {
  padding: 0.75rem 0.9rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mockups-card__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
}

.mockups-card__title {
  font-weight: 600;
  font-size: 0.9375rem;
}

.mockups-card__blurb {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.mockups-card__meta {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
}

.mockups-status {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.mockups-status--ready {
  background: #dcfce7;
  color: #166534;
}

.mockups-status--draft {
  background: #fef3c7;
  color: #92400e;
}

.mockups-status--archived {
  background: #f3f4f6;
  color: #4b5563;
}

.mockups-iframe-wrap {
  flex: 1;
  min-height: 420px;
  border: 1px solid var(--c-border, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  background: #fff;
}

.mockups-iframe {
  width: 100%;
  height: min(70vh, 720px);
  border: 0;
  display: block;
  background: #fff;
}

.mockups-page--preview .mockups-iframe {
  height: calc(100vh - 12rem);
  min-height: 420px;
}

.mockups-vite-panel {
  border: 1px solid var(--c-border, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  padding: 1rem 1.15rem;
  background: var(--c-bg-muted, #f8fafc);
  max-width: 40rem;
}

.mockups-vite-panel p {
  margin: 0 0 0.65rem;
}

.mockups-vite-panel__cmd {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  background: #111827;
  color: #e5e7eb;
  font-size: 0.8125rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* ── FBS: панель «в пути» над сеткой ── */
.wb-fbs-in-transit-panel {
  flex-shrink: 0;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.wb-fbs-in-transit-panel__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'controls stats';
  gap: 1rem 1.25rem;
  align-items: start;
}

.wb-fbs-in-transit-panel__controls {
  grid-area: controls;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

.wb-fbs-in-transit-panel__group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.wb-fbs-in-transit-panel__label {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-text-3);
}

.wb-fbs-in-transit-panel__label-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wb-fbs-in-transit-panel__sort {
  border: 1px solid var(--c-border);
  background: var(--c-bg-2);
  color: var(--c-text-2);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
}

.wb-fbs-in-transit-panel__sort:hover:not(.is-active) {
  border-color: var(--c-border-h);
  color: var(--c-text-1);
}

.wb-fbs-in-transit-panel__sort.is-active {
  border-color: var(--c-primary);
  background: color-mix(in srgb, var(--c-primary) 12%, transparent);
  color: var(--c-primary);
}

.wb-fbs-in-transit-panel__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.wb-fbs-in-transit-panel__chip {
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
}

.wb-fbs-in-transit-panel__chip:hover:not(.is-active) {
  border-color: var(--c-primary-border);
  background: var(--c-primary-bg);
  color: var(--c-primary);
}

.wb-fbs-in-transit-panel__chip.is-active {
  border-color: var(--c-primary);
  background: var(--c-primary-bg);
  color: var(--c-primary);
  font-weight: 650;
}

.wb-fbs-in-transit-panel__stats {
  grid-area: stats;
  display: flex;
  gap: 0.55rem;
  flex-shrink: 0;
  justify-self: end;
  align-self: start;
}

.wb-fbs-in-transit-panel__stat {
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  min-width: 6.25rem;
  max-width: 8.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.wb-fbs-in-transit-panel__stat--count {
  background: var(--c-primary-bg);
  border: 1px solid var(--c-primary-border);
}

.wb-fbs-in-transit-panel__stat--sum {
  background: var(--c-success-bg);
  border: 1px solid #bbf7d0;
  max-width: 10rem;
}

.wb-fbs-in-transit-panel__stat--payout {
  background: color-mix(in srgb, #0d9488 10%, var(--c-bg-1));
  border: 1px solid color-mix(in srgb, #0d9488 35%, var(--c-border));
  flex: 0 0 11.75rem;
  width: 11.75rem;
  min-width: 11.75rem;
  max-width: 11.75rem;
  padding: 0.45rem 0.6rem;
  min-height: 3.85rem;
  box-sizing: border-box;
}

.wb-fbs-in-transit-panel__stat-label {
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--c-primary);
}

.wb-fbs-in-transit-panel__stat--sum .wb-fbs-in-transit-panel__stat-label {
  color: var(--c-success);
}

.wb-fbs-in-transit-panel__stat--payout .wb-fbs-in-transit-panel__stat-label {
  color: #0d9488;
}

.wb-fbs-in-transit-panel__stat strong {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--c-text);
}

.wb-fbs-in-transit-panel__stat--count strong {
  color: var(--c-primary);
}

.wb-fbs-in-transit-panel__stat--sum strong {
  color: var(--c-success);
}

.wb-fbs-in-transit-panel__stat--payout strong {
  color: #0f766e;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-height: 1.2em;
}

.wb-fbs-in-transit-panel__payout-example {
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--c-text-2);
  font-variant-numeric: tabular-nums;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}

.wb-fbs-in-transit-panel__stat--payout .wb-fbs-in-transit-panel__stat-hint {
  min-height: 2.5em;
}

.wb-fbs-in-transit-panel__stat-hint {
  font-size: 0.62rem;
  color: var(--c-text-2);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wb-fbs-in-transit-panel__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.wb-fbs-in-transit-panel__hint {
  font-size: 0.72rem;
  color: var(--c-text-3);
  line-height: 1.35;
}

.wb-fbs-in-transit-panel__reset {
  border: none;
  background: transparent;
  color: var(--c-primary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.wb-fbs-in-transit-panel__reset:hover {
  color: var(--c-primary-h);
}

/* ============================================================
   Multi-tab warning
   ============================================================ */

.sheet-multi-tab-warning {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 900;
  pointer-events: auto;
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.12) 0%, rgba(255, 193, 7, 0.08) 100%);
  border-bottom: 1px solid rgba(255, 152, 0, 0.3);
  backdrop-filter: blur(8px);
}

.sheet-multi-tab-warning__content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.sheet-multi-tab-warning__icon {
  flex-shrink: 0;
  color: #ff9800;
}

.sheet-multi-tab-warning__text {
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--c-text-1);
}

.sheet-multi-tab-warning__text strong {
  font-weight: 600;
  color: #f57c00;
}

.sheet-multi-tab-warning__dismiss {
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--c-text-2);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.sheet-multi-tab-warning__dismiss:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--c-text-1);
}

/* Fortune Search/Replace: глобальные `input { width:100% }` ломают компактную вёрстку. */
#fortune-search-replace.fortune-dialog {
  min-width: 560px;
  max-width: min(640px, 92vw);
  overflow: visible;
}

#fortune-search-replace .ctBox {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}

#fortune-search-replace .ctBox .row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

#fortune-search-replace .inputBox {
  flex: 1 1 auto;
  min-width: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#fortune-search-replace .inputBox .textboxs {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  height: auto;
  min-height: 32px;
  line-height: 1.3;
  white-space: nowrap;
}

#fortune-search-replace .inputBox .textboxs input.formulaInputFocus,
#fortune-search-replace .inputBox .textboxs input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  height: 32px;
  margin: 0;
  padding: 0.35rem 0.6rem;
  box-sizing: border-box;
}

#fortune-search-replace .checkboxs {
  flex: 0 0 auto;
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 11.5rem;
}

#fortune-search-replace .checkboxs > div {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  height: auto;
  min-height: 28px;
  line-height: 1.3;
}

#fortune-search-replace .checkboxs input[type='checkbox'] {
  float: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  max-width: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--c-primary, #7c3aed);
}

#fortune-search-replace .checkboxs span {
  white-space: nowrap;
}

#fortune-search-replace .btnBox {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

#fortune-search-replace .btnBox .button-default,
#fortune-search-replace .btnBox .fortune-message-box-button {
  margin: 0 !important;
}

#fortune-search-replace .close-button {
  margin-top: 12px;
}


