/* Only the two nomenclature cards. Business visibility uses [hidden] separately. */
.nom-tabbed-card { min-width: 0; }
.nom-tabbed-card > .nom-tab-inactive { display: none !important; }
.modal-box > .nom-tabbed-card > .card-head { z-index: 4; flex-shrink: 0; }
/* Шапка: фото и название — первой строкой, кнопки — под ними; не помещаются — переносятся, за край не уходят. */
.nom-tabbed-card > .card-head { flex-wrap: wrap; row-gap: 8px; }
.nom-tabbed-card > .card-head > .nom-card-heading { flex: 1 1 0; min-width: 0; }
.nom-card-heading > .card-title { overflow-wrap: anywhere; white-space: normal; }
/* Код позиции и автор — строкой под названием: «N001139 · Создал: …». Пустое не показывается. */
.nom-card-heading > .nom-card-meta { display: block; overflow-wrap: anywhere; margin-top: 4px; }
.nom-card-meta > span:empty { display: none; }
.nom-card-meta > span:not(:empty) ~ span:not(:empty)::before { content: ' · '; }
.nom-card-meta:not(:has(> span:not(:empty))) { display: none; }
.nom-tabbed-card > .card-head > .row-actions { flex: 1 1 100%; min-width: 0; flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
.nom-tabbed-card > .nom-card-tabs {
  display: flex; gap: 4px; flex-shrink: 0; min-width: 0; max-width: 100%;
  position: sticky; top: var(--nom-card-head-height, 58px); z-index: 3;
  flex-wrap: wrap; row-gap: 4px; background: var(--surface, #fff);
  border-bottom: 1px solid var(--line, #e8e8e5); padding: 8px 12px;
  margin-bottom: 0; scrollbar-width: thin;
}
.nom-card-tab {
  flex: 0 0 auto; border: 1px solid transparent; border-radius: 6px;
  padding: 8px 10px; background: transparent; color: var(--ink-2, #6b6f72);
  font: inherit; cursor: pointer; white-space: nowrap;
}
.nom-card-tab:hover { background: var(--bg-soft, #fafaf9); color: var(--ink, #17181a); }
.nom-card-tab[aria-selected="true"] {
  background: var(--accent-soft, #e9f2ef); color: var(--accent, #0d5c46);
  border-color: var(--field-line, #bcd6c8); font-weight: 600;
}
.nom-card-tab:focus-visible { outline: 2px solid var(--accent, #0d5c46); outline-offset: -2px; }
.nom-tabbed-card > [role="tabpanel"] { flex-shrink: 0; min-width: 0; }
.nom-tabbed-card > details[role="tabpanel"] {
  margin: 12px; border-top: 0; padding: 13px 15px 15px; overflow-wrap: anywhere;
}
.nom-tabbed-card > details[role="tabpanel"] > [data-crm-host],
.nom-tabbed-card > details[role="tabpanel"] > [data-analog-host] { margin-top: 0; min-width: 0; }
.nom-tabbed-card .crm-card-section .card-head,
.nom-tabbed-card .crm-card-section .row-actions { flex-wrap: wrap; gap: 8px; }
.nom-tabbed-card .crm-card-section .card-head > .row-actions { min-width: 0; }
.nom-tabbed-card > details[role="tabpanel"] > summary { display: none; }
.nom-tab-empty { margin: 12px; padding: 13px 15px 24px; }
@media (max-width: 600px) {
  .nom-tabbed-card > .card-head > .nom-card-heading { flex-basis: 100%; }
  .nom-tabbed-card > .card-head > .row-actions { flex-wrap: wrap; }
  .nom-card-tab { min-height: 44px; }
  .nom-tabbed-card > .group > .grid { grid-template-columns: minmax(0, 1fr); }
}

/* Вкладка «Описание»: счётчик знаков под полем. */
.idesc-group .field { margin-top: 10px; min-width: 0; }
.idesc-group textarea { width: 100%; resize: vertical; }
.idesc-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.idesc-foot small { overflow-wrap: anywhere; }
.idesc-warn { color: #8a5a00; }
.idesc-meta { font-size: 12px; margin: 4px 0 0; }
.idesc-status { font-size: 12px; margin-top: 8px; min-height: 1em; }
/* Свободный остаток 1С — в правом верхнем углу шапки карточки, в строке с наименованием: крупно, жирно, зелёным. */
.nom-stock-pill:empty { display: none; }
.nom-stock-pill { margin-left: auto; align-self: flex-start; padding-top: 2px; color: var(--ok, #0d5c46);
  font-size: 16px; font-weight: 700; line-height: 1.3; white-space: nowrap; cursor: help; }
@media (max-width: 700px) { .nom-stock-pill { white-space: normal; margin-left: 0; } }
