:root {
  --brand: #ff5100;
  --brand-strong: #b83d00;
  --brand-soft: #fff1e8;
  --canvas: #f5f5f7;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #8e8e93;
  --line: rgba(29, 29, 31, 0.1);
  --line-soft: rgba(29, 29, 31, 0.065);
  --inset: #f0f0f3;
  --control: #f3f3f5;
  --danger: #a3293d;
  --danger-bg: #fff0f1;
  --warning: #73500e;
  --warning-bg: #fff2d8;
  --info: #304b7d;
  --info-bg: #e9effc;
  --success: #246140;
  --success-bg: #e5f3eb;
  --focus: rgba(255, 81, 0, 0.3);
  --shadow-card: 0 0 0 1px rgba(0, 0, 0, 0.035),
    0 2px 8px rgba(0, 0, 0, 0.045);
  --shadow-float: 0 0 0 1px rgba(0, 0, 0, 0.05),
    0 8px 24px rgba(41, 27, 20, 0.12);
  --radius-card: 14px;
  --radius-control: 10px;
  --radius-chip: 6px;
  --sidebar-width: 224px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
summary {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: var(--brand-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

svg {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

::selection {
  background: #ffd7c3;
  color: var(--ink);
}

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

.num {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--ink-2);
  font-weight: 400;
}

.break-anywhere {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  width: var(--sidebar-width);
  height: 100vh;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid rgba(0, 0, 0, 0.075);
  background: var(--surface);
}

.brand {
  display: flex;
  height: 68px;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  color: var(--ink);
  text-decoration: none;
}

.sidebar > .brand {
  border-bottom: 1px solid var(--line-soft);
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  background: #fff;
}

.brand-mark::before {
  top: 9px;
  left: 8px;
  width: 18px;
  height: 3px;
  border-radius: 2px;
}

.brand-mark::after {
  top: 9px;
  left: 15px;
  width: 3px;
  height: 16px;
  border-radius: 2px;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.brand-copy span {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 11px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
}

.nav-item {
  position: relative;
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border-radius: 10px;
  color: #3a3a3c;
  font-weight: 650;
  text-decoration: none;
}

.nav-item:nth-child(4) {
  margin-top: 21px;
}

.nav-item:nth-child(4)::after {
  position: absolute;
  top: -11px;
  left: 8px;
  right: 8px;
  height: 1px;
  background: var(--line);
  content: "";
}

.nav-item svg {
  color: var(--ink-2);
}

.nav-item:hover {
  background: #f8f8fa;
}

.nav-item:active {
  transform: scale(0.985);
}

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.nav-item.active::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
  content: "";
}

.nav-item.active svg {
  color: var(--brand);
}

.owner-lock {
  width: 14px;
  height: 14px;
  margin-left: auto;
  color: var(--ink-3) !important;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 14px 16px 18px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-2);
  font-size: 12px;
}

.support-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2f8a58;
  box-shadow: 0 0 0 3px #e5f3eb;
}

.workspace {
  display: flex;
  min-width: 0;
  min-height: 100vh;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  height: 60px;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.topbar-context {
  color: var(--ink-2);
  font-size: 13px;
}

.topbar-spacer {
  flex: 1;
}

.top-user {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.top-user > span:last-child {
  min-width: 0;
}

.top-user strong,
.top-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-user strong {
  max-width: 210px;
  font-size: 13px;
}

.top-user small {
  margin-top: 1px;
  color: var(--ink-2);
  font-size: 10px;
}

.avatar {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #4b5b87;
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.avatar-small {
  width: 24px;
  height: 24px;
  font-size: 9px;
}

.logout-form {
  margin: 0;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink-2);
}

.icon-button:hover {
  background: var(--inset);
  color: var(--ink);
}

.icon-button:active {
  transform: scale(0.97);
}

.mobile-header {
  display: none;
}

.page {
  width: 100%;
  max-width: 1600px;
  flex: 1;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

.page-header {
  display: flex;
  min-height: 64px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.page-title {
  min-width: 0;
}

.page-title h1 {
  max-width: 760px;
  margin: 0;
  font-size: 25px;
  line-height: 1.18;
  letter-spacing: -0.028em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.page-title p {
  max-width: 760px;
  margin: 5px 0 0;
  color: var(--ink-2);
  font-size: 13px;
  text-wrap: pretty;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--ink-2);
  font-size: 12px;
}

.breadcrumb a {
  color: var(--brand-strong);
  font-weight: 650;
  text-decoration: none;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 130ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 130ms cubic-bezier(0.23, 1, 0.32, 1),
    background-color 130ms linear;
}

.button svg {
  width: 16px;
  height: 16px;
}

.button:hover {
  box-shadow: 0 2px 6px rgba(82, 31, 8, 0.12);
}

.button:active {
  transform: scale(0.97);
}

.button-primary {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
  color: #fff;
}

.button-primary:hover {
  background: #a63700;
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: rgba(184, 61, 0, 0.2);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.button-wide {
  width: 100%;
}

.card {
  min-width: 0;
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-card);
}

.card-header,
.section-heading-row {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-soft);
}

.card-header h2,
.section-heading-row h2,
.form-card h2,
.comment-box h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.card-header p,
.section-heading-row p,
.form-card > p {
  margin: 3px 0 0;
  color: var(--ink-2);
  font-size: 12px;
}

.count-badge,
.result-badge,
.owner-badge {
  display: inline-grid;
  min-width: 26px;
  min-height: 26px;
  place-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--inset);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.result-badge,
.owner-badge {
  display: inline-flex;
  gap: 5px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.owner-badge svg {
  width: 12px;
  height: 12px;
}

.count-badge.danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.flash,
.form-error {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding: 10px 13px;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 600;
}

.flash {
  background: var(--success-bg);
  color: var(--success);
}

.flash svg {
  width: 16px;
  height: 16px;
}

.form-error {
  background: var(--danger-bg);
  color: var(--danger);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(230px, 1.6fr) repeat(3, minmax(130px, 0.7fr)) auto auto auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.toolbar label {
  min-width: 0;
}

.toolbar input,
.toolbar select,
.stack-form input,
.stack-form select,
.stack-form textarea,
.upload-form input[type="file"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--control);
  color: var(--ink);
}

.toolbar input,
.toolbar select,
.stack-form input,
.stack-form select,
.stack-form textarea {
  padding: 9px 11px;
}

.toolbar input:hover,
.toolbar select:hover,
.stack-form input:hover,
.stack-form select:hover,
.stack-form textarea:hover {
  border-color: rgba(29, 29, 31, 0.12);
}

.toolbar input:focus,
.toolbar select:focus,
.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus {
  border-color: var(--brand);
  outline: 3px solid var(--focus);
  background: var(--surface);
}

.toolbar input::placeholder,
.stack-form input::placeholder,
.stack-form textarea::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.search-field {
  position: relative;
  display: block;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  width: 16px;
  height: 16px;
  color: var(--ink-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-field input {
  padding-left: 38px;
}

.toolbar-result {
  padding: 0 7px;
  color: var(--ink-2);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.data-card {
  overflow: hidden;
}

.dorabotki-total {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 18px;
}

.dorabotki-total > div {
  display: grid;
  gap: 3px;
}

.dorabotki-total > div > strong {
  color: var(--ink);
  font-size: 14px;
}

.dorabotki-total > div > span {
  color: var(--ink-2);
  font-size: 12px;
}

.dorabotki-total > .num {
  color: var(--brand-strong);
  font-size: 30px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.035em;
}

.dorabotki-view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
}

.dorabotki-view-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: var(--radius-control);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 680;
  text-decoration: none;
  transition: background-color 130ms linear, color 130ms linear,
    box-shadow 130ms linear, transform 130ms cubic-bezier(0.23, 1, 0.32, 1);
}

.dorabotki-view-link:hover,
.dorabotki-view-link.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 81, 0, 0.16);
}

.dorabotki-view-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.dorabotki-view-link:active {
  transform: scale(0.97);
}

.dorabotki-view-link .num {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface);
  color: inherit;
  font-size: 10px;
}

.dorabotki-log-controls {
  margin-bottom: 14px;
  padding: 10px 12px;
}

.dorabotki-log-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
}

.dorabotki-log-search label {
  min-width: 0;
}

.dorabotki-log-search input[type="search"] {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  outline: 0;
  background: var(--control);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.dorabotki-log-search input[type="search"]:focus {
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--focus);
}

.dorabotki-log-reset {
  padding: 8px 4px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
}

.dorabotki-log-summary {
  margin: 0 2px 10px;
  color: var(--ink-2);
  font-size: 12px;
}

.dorabotki-log-summary > span {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dorabotki-log-day + .dorabotki-log-day {
  margin-top: 16px;
}

.dorabotki-log-day > h2 {
  margin: 0 2px 7px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.dorabotki-log-list {
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
}

.dorabotki-log-event {
  display: flex;
  min-width: 0;
  min-height: 52px;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
}

.dorabotki-log-event:last-child {
  border-bottom: 0;
}

.dorabotki-log-event:hover {
  background: #fffaf7;
}

.dorabotki-log-event > time {
  flex: 0 0 auto;
  color: var(--ink-2);
  font-size: 12px;
}

.dorabotki-log-separator {
  color: var(--ink-3);
}

.dorabotki-log-task {
  flex: 0 0 auto;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 720;
  text-decoration: none;
}

a.dorabotki-log-task:hover {
  text-decoration: underline;
}

.dorabotki-log-title {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 680;
  overflow-wrap: anywhere;
}

.dorabotki-log-result {
  min-width: 0;
  color: var(--ink-2);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.dorabotki-log-empty,
.dorabotki-log-filter-empty {
  padding: 28px 16px;
}

.dorabotki-log-filter-empty[hidden] {
  display: none;
}

.dorabotki-filters {
  display: grid;
  grid-template-columns: minmax(150px, 0.28fr) minmax(0, 1.72fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.dorabotki-filter-copy {
  display: grid;
  gap: 2px;
  padding: 0 4px;
}

.dorabotki-filter-copy strong {
  color: var(--ink);
  font-size: 13px;
}

.dorabotki-filter-copy span {
  color: var(--ink-2);
  font-size: 11px;
}

.dorabotki-filter-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.dorabotki-filter {
  display: flex;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-control);
  background: var(--control);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--line-soft);
  transition: background-color 130ms linear, color 130ms linear,
    box-shadow 130ms linear, transform 130ms cubic-bezier(0.23, 1, 0.32, 1);
}

.dorabotki-filter:hover,
.dorabotki-filter.active {
  background: var(--surface);
  color: var(--brand-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 81, 0, 0.26);
}

.dorabotki-filter:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.dorabotki-filter:active {
  transform: scale(0.97);
}

.dorabotki-filter .chip {
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dorabotki-filter .num {
  flex: 0 0 auto;
  color: inherit;
  font-size: 11px;
}

.dorabotki-category > summary {
  list-style: none;
  user-select: none;
  transition: background-color 130ms linear;
}

.dorabotki-category > summary::-webkit-details-marker {
  display: none;
}

.dorabotki-category > summary:hover {
  background: #fffaf7;
}

.dorabotki-category > summary:focus-visible {
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.dorabotki-category:not([open]) > summary {
  border-bottom-color: transparent;
  border-radius: var(--radius-card);
}

.dorabotki-category:not([open]) > summary:focus-visible {
  border-radius: var(--radius-card);
}

.dorabotki-category-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.dorabotki-disclosure-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--control);
  color: var(--ink-2);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1),
    background-color 130ms linear;
}

.dorabotki-category[open] .dorabotki-disclosure-icon {
  transform: rotate(180deg);
}

.dorabotki-category-header .count-badge {
  flex: 0 0 auto;
}

.dorabotki-statusbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  border-bottom: 1px solid var(--line-soft);
  background: #fafafb;
}

.dorabotki-status-count {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  box-shadow: inset -1px 0 var(--line-soft);
}

.dorabotki-status-count:last-child {
  box-shadow: none;
}

.dorabotki-status-count .num {
  color: var(--ink);
  font-size: 12px;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th:nth-child(1) {
  width: 24%;
}

.data-table th:nth-child(2) {
  width: 13%;
}

.data-table th:nth-child(3) {
  width: 10%;
}

.data-table th:nth-child(4) {
  width: 17%;
}

.data-table th:nth-child(5) {
  width: 17%;
}

.data-table th:nth-child(6) {
  width: 19%;
}

.dorabotki-table th:nth-child(1) {
  width: 19%;
}

.dorabotki-table th:nth-child(2) {
  width: 10%;
}

.dorabotki-table th:nth-child(3) {
  width: 10%;
}

.dorabotki-table th:nth-child(4),
.dorabotki-table th:nth-child(5) {
  width: 48px;
  text-align: center;
}

.dorabotki-table th:nth-child(4) .sort-link,
.dorabotki-table th:nth-child(5) .sort-link {
  justify-content: center;
  padding-right: 4px;
  padding-left: 4px;
}

.dorabotki-table th:nth-child(6),
.dorabotki-table th:nth-child(7),
.dorabotki-table th:nth-child(8) {
  width: 10%;
}

.dorabotki-table th:nth-child(9) {
  width: 25%;
}

.dorabotki-part-cell {
  width: 48px;
  padding-right: 4px !important;
  padding-left: 4px !important;
  text-align: center;
}

.dorabotki-part {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: var(--radius-chip);
  font-size: 15px;
  font-weight: 750;
  line-height: 1;
}

.dorabotki-part-yes { color: var(--success); background: var(--success-bg); }
.dorabotki-part-no { color: var(--ink-3); background: var(--control); }
.dorabotki-part-shared { color: var(--brand-strong); background: var(--brand-soft); }

.data-table thead th {
  height: 40px;
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: #fafafb;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 650;
  text-align: left;
}

.sort-link {
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
}

.sort-link > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sort-link:hover,
.sort-link.active {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.sort-link:focus-visible {
  border-radius: 6px;
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.sort-indicator {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.data-table thead .sort-link {
  width: 100%;
  min-height: 40px;
  padding-right: 12px;
  padding-left: 12px;
}

.list-sortbar {
  display: grid;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: #fafafb;
}

.companies-sortbar {
  display: none;
}

.contact-sortbar {
  grid-template-columns: 30px minmax(130px, 1fr) minmax(110px, 0.8fr) minmax(130px, 1fr) auto;
  gap: 10px;
  padding: 0 26px;
}

.history-sortbar {
  grid-template-columns: 112px 16px minmax(0, 1fr);
  gap: 10px;
  padding: 0 16px;
}

.compact-sortbar {
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 10px;
  padding: 0 16px;
}

.reminder-page-sortbar {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  overflow: hidden;
  border-top: 0;
}

.employee-sortbar {
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.45fr) auto;
  gap: 12px;
  padding: 0 16px;
}

.data-table tbody td {
  height: 62px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: #3a3a3c;
  vertical-align: middle;
}

.dorabotki-result {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.dorabotki-date {
  white-space: normal;
}

.dorabotki-subtask-summary {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--inset);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.dorabotki-subtask-title {
  display: grid;
  min-width: 0;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
}

.dorabotki-tree-mark {
  color: var(--brand);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.2;
}

.dorabotki-subtask-row {
  background: var(--inset);
}

.dorabotki-subtask-row td:first-child {
  box-shadow: inset 3px 0 var(--brand);
}

.dorabotki-group-row td {
  height: auto;
  padding: 12px 16px;
  background: var(--inset);
}

.dorabotki-group-heading,
.dorabotki-group-meta {
  display: flex;
  min-width: 0;
  align-items: center;
}

.dorabotki-group-heading {
  justify-content: space-between;
  gap: 16px;
}

.dorabotki-group-heading > div:first-child {
  min-width: 0;
}

.dorabotki-group-meta {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dorabotki-group-row .dorabotki-subtask-summary {
  margin-top: 0;
  background: var(--surface);
}

.dorabotki-empty-row td {
  height: auto;
  padding: 24px 16px;
  color: var(--ink-2);
  text-align: center;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fffaf7;
}

.company-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-weight: 680;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-name:hover {
  color: var(--brand-strong);
  text-decoration: underline;
}

.subline {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person,
.fleet,
.due {
  display: flex;
  min-width: 0;
  align-items: center;
}

.person {
  gap: 8px;
}

.person > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fleet {
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.fleet strong {
  font-variant-numeric: tabular-nums;
}

.fleet span {
  color: var(--ink-2);
  font-size: 11px;
}

.chip {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: var(--radius-chip);
  background: var(--inset);
  color: #45454d;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.chip.work {
  background: var(--warning-bg);
  color: var(--warning);
}

.chip.sent {
  background: var(--info-bg);
  color: var(--info);
}

.chip.client {
  background: var(--success-bg);
  color: var(--success);
}

.chip.lost {
  background: var(--danger-bg);
  color: var(--danger);
}

.chip.new {
  background: #ededf2;
  color: #45454d;
}

.due {
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.due::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #b8b8be;
  content: "";
}

.due.overdue {
  color: var(--danger);
}

.due.overdue::before {
  background: #d64560;
}

.due.future {
  color: var(--ink-2);
  font-weight: 550;
}

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 12px;
}

.pagination > :last-child {
  justify-self: end;
}

.empty-state {
  display: grid;
  min-height: 190px;
  padding: 28px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-state h3 {
  margin: 10px 0 0;
  font-size: 16px;
}

.empty-state p {
  max-width: 420px;
  margin: 5px 0 0;
  color: var(--ink-2);
  font-size: 12px;
  text-wrap: pretty;
}

.empty-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 800;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(330px, 0.78fr);
  align-items: start;
  gap: 14px;
}

.detail-column,
.settings-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.info-card {
  overflow: hidden;
}

.company-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  margin: 0;
  padding: 8px 16px 16px;
}

.company-facts > div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

.company-facts > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.company-facts .fact-wide {
  grid-column: 1 / -1;
}

.company-facts dt {
  color: var(--ink-2);
  font-size: 12px;
}

.company-facts dd {
  min-width: 0;
  margin: 0;
  font-size: 12px;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px 16px;
}

.contact-list > .empty-state {
  min-height: 150px;
}

.contact-row {
  display: grid;
  grid-template-columns: 30px minmax(130px, 1fr) minmax(110px, 0.8fr) minmax(130px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: #fafafb;
}

.contact-main,
.contact-meta {
  min-width: 0;
}

.contact-main strong,
.contact-main span {
  display: block;
}

.contact-main strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-main span,
.contact-meta {
  color: var(--ink-2);
  font-size: 11px;
}

.comment-box {
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px;
}

.route-line {
  border-radius: 2px;
  background: var(--brand);
}

.comment-box p {
  margin: 4px 0 0;
  color: #3a3a3c;
  font-size: 12px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.history-card {
  overflow: hidden;
}

.history-list {
  padding: 2px 16px 10px;
}

.history-list > .empty-state {
  min-height: 160px;
}

.history-item {
  display: grid;
  grid-template-columns: 112px 16px minmax(0, 1fr);
  min-height: 68px;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.history-item:last-child {
  border-bottom: 0;
}

.history-time {
  color: var(--ink-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.history-node {
  position: relative;
  width: 10px;
  height: 10px;
  margin-top: 3px;
  border: 2px solid var(--brand);
  border-radius: 50%;
  background: var(--surface);
}

.history-node::after {
  position: absolute;
  top: 10px;
  left: 2px;
  width: 2px;
  height: 50px;
  background: var(--line);
  content: "";
}

.history-item:last-child .history-node::after {
  display: none;
}

.history-content {
  min-width: 0;
}

.history-content strong {
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.history-content p {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 11px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.work-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 18px 22px;
}

.work-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--brand);
  content: "";
}

.work-card h2 {
  margin: 0;
  font-size: 17px;
}

.work-lead {
  margin: 5px 0 15px;
  color: var(--ink-2);
  font-size: 12px;
}

.placeholder-guidance {
  padding: 16px;
  border-radius: 12px;
  background: var(--brand-soft);
}

.placeholder-guidance .empty-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface);
}

.placeholder-guidance strong {
  display: block;
  margin-top: 10px;
}

.placeholder-guidance p {
  margin: 3px 0 0;
  color: #7d3c1e;
  font-size: 11px;
}

.form-card {
  padding: 16px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stack-form.compact,
.settings-form {
  gap: 11px;
  margin-top: 13px;
}

.stack-form label,
.upload-form label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: #3a3a3c;
  font-size: 12px;
  font-weight: 620;
}

.stack-form textarea {
  min-height: 96px;
  resize: vertical;
}

.new-company-card {
  max-width: 780px;
  margin: 12px auto 0;
  padding: 18px;
}

.new-company-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1.45fr) repeat(2, minmax(150px, 0.8fr));
  gap: 12px;
}

.new-company-fields > label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 650;
}

.new-company-duplicates {
  padding: 12px 14px;
  border-radius: var(--radius-control);
  background: var(--warning-bg);
  color: var(--warning);
}

.new-company-duplicates > strong {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
}

.new-company-duplicates ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.new-company-duplicates li {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  align-items: baseline;
  font-size: 12px;
}

.new-company-duplicates a {
  color: var(--brand-strong);
  font-weight: 700;
}

.new-company-duplicates li span {
  color: var(--ink-2);
}

.new-company-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.compact-card {
  overflow: hidden;
}

.compact-list {
  margin: 0;
  padding: 4px 16px 12px;
  list-style: none;
}

.compact-list li {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}

.compact-list li:last-child {
  border-bottom: 0;
}

.compact-list time {
  color: var(--brand-strong);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.reminder-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(440px, 1.22fr);
  align-items: start;
  gap: 14px;
}

.reminder-panel {
  overflow: hidden;
}

.reminder-panel.later {
  grid-column: 1 / -1;
}

.reminder-list {
  padding: 8px 10px 12px;
}

.reminder-list > .empty-state {
  min-height: 180px;
}

.reminder-item {
  position: relative;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  min-height: 82px;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 17px;
  border-bottom: 1px solid var(--line-soft);
}

.reminder-item:last-child {
  border-bottom: 0;
}

.reminder-item::before {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 2px;
  width: 3px;
  border-radius: 3px;
  background: var(--brand);
  content: "";
}

.reminder-item.overdue::before {
  background: #d64560;
}

.reminder-when {
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.reminder-item.overdue .reminder-when {
  color: var(--danger);
}

.reminder-main {
  min-width: 0;
}

.reminder-main a {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 680;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reminder-main a:hover {
  color: var(--brand-strong);
  text-decoration: underline;
}

.reminder-main p {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(410px, 0.98fr);
  align-items: start;
  gap: 14px;
}

.employee-list {
  padding: 2px 16px 10px;
}

.employee-list > .empty-state {
  min-height: 180px;
}

.employee-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.45fr) auto;
  min-height: 72px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.employee-row:last-child {
  border-bottom: 0;
}

.employee-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.employee-main > div {
  min-width: 0;
}

.employee-main strong,
.employee-main span {
  display: block;
}

.employee-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-main span {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 11px;
}

.role-badge {
  font-size: 12px;
  font-weight: 650;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 11px;
  white-space: nowrap;
}

.state::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  content: "";
}

.state.active {
  color: var(--success);
}

.state.active::before {
  background: #2f8a58;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.import-card {
  overflow: hidden;
}

.import-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.upload-form {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #fafafb;
}

.upload-form input[type="file"] {
  min-height: 46px;
  padding: 7px;
  color: var(--ink-2);
  font-size: 11px;
}

.upload-form input[type="file"]::file-selector-button {
  height: 30px;
  margin-right: 8px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
}

.import-report {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--success-bg);
  color: var(--success);
}

.import-report h3 {
  margin: 0 0 10px;
  font-size: 12px;
}

.import-report > div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.import-report > div > div {
  min-width: 0;
}

.import-report strong,
.import-report span {
  display: block;
}

.import-report strong {
  font-size: 19px;
  line-height: 1;
}

.import-report span {
  margin-top: 4px;
  font-size: 10px;
}

.soon-card {
  min-height: min(520px, calc(100vh - 190px));
}

.soon-card .empty-state {
  height: 100%;
  min-height: inherit;
}

.error-card {
  display: flex;
  min-height: min(520px, calc(100vh - 100px));
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px;
  text-align: center;
}

.error-code {
  color: var(--brand);
  font-size: clamp(58px, 9vw, 108px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.error-card h1 {
  margin: 22px 0 0;
  font-size: 25px;
  letter-spacing: -0.025em;
}

.error-card p {
  max-width: 480px;
  margin: 8px 0 22px;
  color: var(--ink-2);
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 81, 0, 0.05), transparent 42%),
    var(--canvas);
}

.login-shell {
  width: 100%;
  max-width: 430px;
}

.login-card {
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

.login-card .brand {
  border-bottom: 1px solid var(--line-soft);
}

.login-copy,
.login-card > .stack-form,
.login-card > .flash,
.login-card > .form-error,
.login-note {
  margin-right: 28px;
  margin-left: 28px;
}

.login-copy {
  margin-top: 26px;
  margin-bottom: 20px;
}

.login-copy h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.login-copy p {
  margin: 7px 0 0;
  color: var(--ink-2);
  font-size: 13px;
}

.login-card > .stack-form {
  margin-bottom: 22px;
}

.login-note {
  margin-top: 0;
  margin-bottom: 24px;
  color: var(--ink-3);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 208px;
  }

  .toolbar {
    grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(116px, 0.7fr)) auto auto;
  }

  .toolbar-result {
    display: none;
  }

  .data-table th:nth-child(5),
  .data-table td:nth-child(5) {
    display: none;
  }

  .data-table th:nth-child(1) {
    width: 28%;
  }

  .data-table th:nth-child(2) {
    width: 16%;
  }

  .data-table th:nth-child(3) {
    width: 12%;
  }

  .data-table th:nth-child(4) {
    width: 21%;
  }

  .data-table th:nth-child(6) {
    width: 23%;
  }

  .detail-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
  }

  .contact-row {
    grid-template-columns: 30px minmax(130px, 1fr) minmax(110px, 0.8fr) auto;
  }

  .contact-row .contact-meta:nth-of-type(3) {
    display: none;
  }

  .contact-sortbar {
    grid-template-columns: 30px minmax(130px, 1fr) minmax(110px, 0.8fr) auto;
  }

  .contact-sortbar .sort-link:nth-of-type(3) {
    display: none;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar,
  .topbar {
    display: none;
  }

  .workspace {
    min-height: 100vh;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    height: 60px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
  }

  .mobile-header .brand {
    height: 60px;
    padding: 0 14px;
  }

  .mobile-header .brand-mark {
    width: 32px;
    height: 32px;
  }

  .mobile-menu {
    position: relative;
    padding-right: 8px;
  }

  .mobile-menu > summary {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 11px;
    color: var(--ink);
    list-style: none;
  }

  .mobile-menu > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-menu[open] > summary {
    background: var(--brand-soft);
    color: var(--brand-strong);
  }

  .mobile-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 10px 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-float);
  }

  .mobile-nav .nav-item:nth-child(4) {
    margin-top: 4px;
  }

  .mobile-nav .nav-item:nth-child(4)::after {
    display: none;
  }

  .page {
    padding: 18px 16px 32px;
  }

  .detail-grid,
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .reminder-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .reminder-panel.later {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .page {
    padding: 16px 12px 28px;
  }

  .page-header {
    min-height: 0;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
  }

  .page-title h1 {
    font-size: 23px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions > * {
    max-width: 100%;
  }

  .new-company-card {
    margin-top: 0;
    padding: 14px;
  }

  .new-company-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .new-company-actions {
    flex-direction: column-reverse;
  }

  .new-company-actions .button {
    width: 100%;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-bottom: 12px;
  }

  .toolbar .search-field,
  .toolbar label:nth-of-type(4),
  .toolbar-result {
    grid-column: 1 / -1;
  }

  .toolbar .button {
    width: 100%;
  }

  .data-card {
    overflow: visible;
    background: transparent;
    box-shadow: none;
  }

  .dorabotki-total {
    min-height: 66px;
    padding: 12px 14px;
  }

  .dorabotki-total > .num {
    font-size: 27px;
  }

  .dorabotki-view-switch {
    display: grid;
    width: 100%;
  }

  .dorabotki-log-controls {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .dorabotki-log-search {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dorabotki-log-reset {
    grid-column: 1 / -1;
    justify-self: start;
    padding: 4px;
  }

  .dorabotki-log-event {
    min-height: 0;
    align-items: flex-start;
    padding: 11px 12px;
  }

  .dorabotki-log-title,
  .dorabotki-log-result {
    flex: 1 1 180px;
  }

  .dorabotki-filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    padding: 12px;
  }

  .dorabotki-filter-copy {
    padding: 0;
  }

  .dorabotki-filter-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dorabotki-category-header {
    min-height: 54px;
    padding: 0 4px;
    border-bottom: 0;
  }

  .dorabotki-category:not([open]) > .dorabotki-category-header {
    padding: 0 14px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
  }

  .dorabotki-category > summary:focus-visible {
    border-radius: var(--radius-card);
  }

  .dorabotki-statusbar {
    margin-bottom: 10px;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-card);
  }

  .companies-sortbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 10px;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-card);
  }

  .companies-sortbar .sort-link,
  .reminder-page-sortbar .sort-link {
    border-bottom: 1px solid var(--line-soft);
  }

  .contact-sortbar,
  .history-sortbar,
  .compact-sortbar,
  .reminder-page-sortbar,
  .employee-sortbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 0;
  }

  .contact-sortbar .sort-spacer,
  .history-sortbar .sort-spacer {
    display: none;
  }

  .contact-sortbar .sort-link:nth-of-type(3) {
    display: flex;
  }

  .list-sortbar .sort-link {
    padding-right: 12px;
    padding-left: 12px;
  }

  .table-scroll {
    overflow: visible;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody {
    display: grid;
    gap: 10px;
  }

  .data-table tbody tr {
    overflow: hidden;
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-card);
  }

  .data-table tbody tr:hover {
    background: var(--surface);
  }

  .data-table tbody td,
  .data-table tbody td:nth-child(5) {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    min-height: 44px;
    height: auto;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line-soft);
  }

  .data-table td::before {
    color: var(--ink-2);
    font-size: 10px;
    font-weight: 600;
    content: attr(data-label);
  }

  .data-table td:first-child {
    display: block;
    padding-top: 14px;
    padding-bottom: 12px;
  }

  .data-table td:first-child::before {
    display: none;
  }

  .data-table td:last-child {
    border-bottom: 0;
  }

  .dorabotki-table .dorabotki-empty-row td {
    display: block;
    padding: 20px 14px;
    text-align: center;
  }

  .dorabotki-table .dorabotki-empty-row td::before {
    display: none;
  }

  .dorabotki-table .dorabotki-subtask-row {
    background: var(--inset);
    box-shadow: inset 3px 0 var(--brand), var(--shadow-card);
  }

  .dorabotki-table .dorabotki-task-row,
  .dorabotki-table .dorabotki-subtask-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dorabotki-table .dorabotki-task-row > td,
  .dorabotki-table .dorabotki-subtask-row > td {
    grid-column: 1 / -1;
  }

  .dorabotki-table .dorabotki-task-row > .dorabotki-part-cell,
  .dorabotki-table .dorabotki-subtask-row > .dorabotki-part-cell {
    display: grid;
    width: 100%;
    grid-column: auto;
    grid-template-columns: 1fr auto;
    text-align: right;
  }

  .dorabotki-table .dorabotki-group-row td {
    display: block;
    padding: 13px 14px;
  }

  .dorabotki-table .dorabotki-group-row td::before {
    display: none;
  }

  .dorabotki-group-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
  }

  .dorabotki-group-meta {
    justify-content: flex-start;
  }

  .company-name,
  .subline,
  .person > span:last-child {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .due {
    white-space: normal;
  }

  .pagination {
    grid-template-columns: 1fr 1fr;
  }

  .pagination > span:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }

  .company-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .company-facts > div,
  .company-facts .fact-wide {
    grid-column: auto;
  }

  .company-facts > div:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line-soft);
  }

  .company-facts > div:last-child {
    border-bottom: 0;
  }

  .contact-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: start;
  }

  .contact-row .contact-meta {
    grid-column: 2 / -1;
  }

  .contact-row .contact-meta:nth-of-type(3) {
    display: block;
  }

  .history-item {
    grid-template-columns: 82px 12px minmax(0, 1fr);
  }

  .reminder-item {
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: start;
  }

  .reminder-item form {
    grid-column: 2;
  }

  .compact-list li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .employee-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 11px 0;
  }

  .employee-row .state {
    grid-column: 2;
  }

  .form-grid,
  .import-forms {
    grid-template-columns: minmax(0, 1fr);
  }

  .import-report > div {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .error-card {
    padding: 28px 18px;
  }

  .login-page {
    align-items: start;
    padding: 14px;
  }

  .login-shell {
    margin-top: 5vh;
  }

  .login-copy,
  .login-card > .stack-form,
  .login-card > .flash,
  .login-card > .form-error,
  .login-note {
    margin-right: 20px;
    margin-left: 20px;
  }
}

.quick-comment textarea {
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--control);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  transition: background-color 130ms linear, box-shadow 130ms linear;
}

.quick-comment textarea:hover {
  box-shadow: inset 0 0 0 1px var(--line);
}

.quick-comment textarea:focus {
  border-color: rgba(255, 81, 0, 0.24);
  outline: 0;
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--focus);
}

.quick-comment textarea::placeholder {
  color: var(--ink-3);
}

@media (min-width: 681px) {
  .dorabotki-table {
    min-width: 1080px;
  }
}

@media (min-width: 681px) and (max-width: 1180px) {
  .dorabotki-table th:nth-child(5),
  .dorabotki-table td:nth-child(5) {
    display: table-cell;
  }
}

@media (max-width: 420px) {
  .mobile-header .brand-copy span {
    display: none;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .toolbar .search-field,
  .toolbar label:nth-of-type(4) {
    grid-column: auto;
  }

  .data-table tbody td,
  .data-table tbody td:nth-child(5) {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .company-facts > div {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .contact-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .contact-row .chip {
    grid-column: 2;
    justify-self: start;
  }

  .history-list {
    padding: 2px 12px 10px;
  }

  .history-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .history-node {
    display: none;
  }

  .reminder-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding-left: 18px;
  }

  .reminder-item form {
    grid-column: auto;
  }

  .reminder-item .button {
    width: 100%;
  }

  .employee-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .employee-sortbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .employee-row .state {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* v1.1: точечный звонок, быстрая лента и действия с напоминаниями */
.phone-list {
  display: inline-flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.phone-entry {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
}

.phone-number {
  min-width: 0;
  color: inherit;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.phone-call {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: var(--radius-control);
  background: var(--brand-soft);
  color: var(--brand-strong);
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(184, 61, 0, 0.12);
  transition: transform 130ms cubic-bezier(0.23, 1, 0.32, 1),
    background-color 130ms linear, color 130ms linear;
}

.phone-call:hover {
  background: var(--brand-strong);
  color: #fff;
}

.phone-call:active {
  transform: scale(0.97);
}

.phone-call svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
}

.company-phone-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 6px;
}

.company-phone-line .phone-list {
  display: inline-flex;
  flex-direction: row;
}

.company-phone-line .phone-call {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

.contact-phones .phone-entry {
  width: 100%;
  justify-content: space-between;
}

.bitrix-comment {
  padding: 16px;
}

.bitrix-comment h2,
.bitrix-comment summary {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.012em;
}

.bitrix-comment summary {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}

.bitrix-comment summary::-webkit-details-marker {
  display: none;
}

.bitrix-comment summary small {
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
}

.bitrix-comment[open] summary small {
  visibility: hidden;
}

.bitrix-comment p {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.quick-comment {
  overflow: hidden;
}

.quick-comment form {
  padding: 12px 16px 16px;
}

.quick-comment textarea {
  display: block;
  width: 100%;
  min-height: 84px;
  resize: vertical;
}

.quick-comment-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.quick-comment-footer > span {
  color: var(--ink-3);
  font-size: 11px;
}

.reminder-grid {
  grid-template-columns: minmax(0, 1fr);
}

.reminder-panel.later {
  grid-column: auto;
}

.reminder-item {
  grid-template-columns: 120px minmax(180px, 1fr) minmax(500px, auto);
}

.reminder-actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.quick-action {
  min-height: 40px;
  padding-right: 10px;
  padding-left: 10px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
}

.quick-action:hover {
  border-color: rgba(184, 61, 0, 0.2);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.quick-action-done {
  border-color: rgba(36, 97, 64, 0.16);
  background: var(--success-bg);
  color: var(--success);
}

.quick-date {
  min-width: 0;
}

.quick-date summary {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 680;
  list-style: none;
  transition: transform 130ms cubic-bezier(0.23, 1, 0.32, 1),
    background-color 130ms linear, color 130ms linear;
}

.quick-date summary::-webkit-details-marker {
  display: none;
}

.quick-date summary:hover,
.quick-date[open] summary {
  border-color: rgba(184, 61, 0, 0.2);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.quick-date summary:active {
  transform: scale(0.97);
}

.quick-date[open] {
  flex-basis: 100%;
}

.quick-date-popover {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
  padding: 10px;
  border-radius: 12px;
  background: var(--inset);
}

.quick-date-popover label {
  display: flex;
  min-width: 210px;
  flex: 1 1 210px;
  flex-direction: column;
  gap: 4px;
  color: var(--ink-2);
  font-size: 11px;
}

.quick-date-popover input {
  width: 100%;
}

.company-reminder-item {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
}

.company-reminder-copy {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 10px;
}

.company-reminder-item .reminder-actions {
  justify-content: flex-start;
}

@media (max-width: 1180px) {
  .reminder-item {
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: start;
  }

  .reminder-item > .reminder-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .company-phone-line {
    align-items: flex-start;
  }

  .contact-phones .phone-entry {
    justify-content: flex-start;
  }

  .quick-comment-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-comment-footer .button {
    width: 100%;
  }

  .reminder-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .reminder-item > .reminder-actions {
    grid-column: 1;
  }

  .reminder-actions {
    justify-content: stretch;
  }

  .reminder-actions .quick-action {
    flex: 1 1 calc(50% - 3px);
    white-space: normal;
  }

  .quick-date {
    flex: 1 1 100%;
  }

  .quick-date summary {
    width: 100%;
  }

  .quick-date-popover {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-date-popover label {
    min-width: 0;
    flex-basis: auto;
  }

  .company-reminder-copy {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
}

/* v1.1: глобальный поиск и редактирование карточки */
.global-search {
  position: relative;
  width: min(440px, 38vw);
  flex: 0 1 440px;
}

.global-search > label {
  position: relative;
  display: block;
}

.global-search > label svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--ink-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.global-search input {
  width: 100%;
  min-height: 38px;
  padding: 8px 74px 8px 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--inset);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.global-search input:focus {
  border-color: var(--brand);
  background: var(--surface);
  outline: 3px solid var(--focus);
  outline-offset: 0;
}

.global-search-submit {
  position: absolute;
  top: 4px;
  right: 4px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: var(--surface);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 700;
}

.global-search-results {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  z-index: 20;
  overflow: hidden;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(42, 32, 28, 0.16);
}

.global-search-results[hidden] {
  display: none;
}

.global-search-results a,
.global-search-empty {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.global-search-results a:hover,
.global-search-results a:focus-visible {
  background: var(--brand-soft);
  outline: none;
}

.global-search-results strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-results span {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-empty {
  color: var(--ink-2);
  font-size: 12px;
}

.edit-disclosure {
  border-top: 1px solid var(--line-soft);
}

.edit-disclosure > summary {
  width: max-content;
  margin: 12px 16px;
  list-style: none;
  cursor: pointer;
}

.edit-disclosure > summary::-webkit-details-marker {
  display: none;
}

.edit-disclosure[open] > summary {
  border-color: rgba(184, 61, 0, 0.22);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.edit-form {
  padding: 16px;
  border-top: 1px solid var(--line-soft);
  background: #fafafb;
}

.edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.edit-grid > label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 650;
}

.edit-grid > label > input,
.edit-grid > label > select,
.repeatable-row input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.edit-grid input:focus,
.edit-grid select:focus {
  border-color: var(--brand);
  outline: 3px solid var(--focus);
  outline-offset: 0;
}

.edit-grid small {
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 500;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.repeatable-fields,
.repeatable-rows {
  display: grid;
  gap: 7px;
}

.repeatable-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.repeatable-remove,
.repeatable-add {
  min-height: 36px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 650;
}

.repeatable-remove:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.repeatable-add {
  width: max-content;
  color: var(--brand-strong);
}

.repeatable-add:hover {
  background: var(--brand-soft);
}

.edit-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.checkbox-field {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: start;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand);
}

.contact-edit {
  grid-column: 1 / -1;
  width: 100%;
  border-top: 0;
}

.contact-edit > summary {
  margin: 0 0 0 40px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.contact-edit .edit-form {
  margin-top: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.contact-create {
  margin-top: 0;
}

.contact-create > summary {
  margin-top: 0;
}

@media (max-width: 1180px) {
  .topbar-context {
    display: none;
  }

  .global-search {
    width: min(420px, 44vw);
  }
}

@media (max-width: 680px) {
  .edit-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-span-2 {
    grid-column: 1;
  }

  .edit-actions .button {
    width: 100%;
  }

  .repeatable-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .repeatable-remove {
    justify-self: start;
    min-height: 30px;
  }
}

/* v1.1: компактные реквизиты для рабочего обзвона */
.company-facts-compact {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 16px;
  padding-top: 4px;
  padding-bottom: 8px;
}

.company-facts-compact > div {
  grid-column: span 6;
  min-height: 34px;
  padding: 6px 0;
}

.company-facts-compact > .communication-fact {
  display: block;
  min-width: 0;
  padding-top: 8px;
  padding-bottom: 8px;
}

.company-facts-compact > .company-phone-fact {
  grid-column: span 6;
}

.company-facts-compact > .company-email-fact,
.company-facts-compact > .company-site-fact {
  grid-column: span 3;
}

.company-facts-compact > .company-address-fact {
  grid-column: span 8;
}

.company-facts-compact > .company-source-fact {
  grid-column: span 4;
}

.communication-fact dt {
  margin-bottom: 4px;
}

.compact-lines,
.compact-more-lines {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.compact-phone-row {
  display: grid;
  min-width: 0;
  min-height: 28px;
  grid-template-columns: minmax(124px, max-content) 28px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.compact-phone-number {
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.compact-phone-row small {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-phone-fact .phone-call {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 8px;
}

.company-phone-fact .phone-call svg {
  width: 14px;
  height: 14px;
}

.compact-link-row {
  display: block;
  min-width: 0;
  min-height: 24px;
  overflow: hidden;
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 600;
  line-height: 24px;
  text-decoration-thickness: 1px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-more {
  min-width: 0;
}

.compact-more > summary {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 4px;
  border-radius: 6px;
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 700;
  list-style-position: inside;
  cursor: pointer;
}

.compact-more > summary:hover,
.compact-more > summary:focus-visible {
  background: var(--brand-soft);
  outline: none;
}

.compact-more[open] > summary {
  margin-bottom: 2px;
}

@media (max-width: 680px) {
  .company-facts-compact {
    grid-template-columns: minmax(0, 1fr);
  }

  .company-facts-compact > div,
  .company-facts-compact > .company-phone-fact,
  .company-facts-compact > .company-email-fact,
  .company-facts-compact > .company-site-fact,
  .company-facts-compact > .company-address-fact,
  .company-facts-compact > .company-source-fact {
    grid-column: 1;
  }

  .compact-phone-row {
    grid-template-columns: minmax(124px, max-content) 28px minmax(0, 1fr);
  }
}

/* v1.1: ровная сетка телефонов компании */
.company-facts-compact > .company-phone-fact {
  position: relative;
  grid-column: span 12;
  overflow: visible;
}

.company-facts-compact > .company-email-fact,
.company-facts-compact > .company-site-fact {
  grid-column: span 6;
}

.company-phone-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 12px;
}

.company-phone-grid .compact-phone-row {
  display: grid;
  height: 30px;
  min-width: 0;
  min-height: 30px;
  grid-template-columns: 24px max-content minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding-right: 6px;
}

.company-phone-grid .compact-phone-number {
  overflow: visible;
  line-height: 30px;
  white-space: nowrap;
}

.company-phone-grid .compact-phone-row small {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-phone-fact .company-phone-grid .phone-call {
  width: 24px;
  height: 24px;
  min-height: 24px;
  flex-basis: 24px;
  border-radius: 7px;
}

.company-phone-fact .company-phone-grid .phone-call svg {
  width: 12px;
  height: 12px;
}

.phone-more {
  position: relative;
  width: max-content;
  margin-top: 3px;
}

.phone-more > summary {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 6px;
  border-radius: 6px;
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.phone-more > summary:hover,
.phone-more > summary:focus-visible {
  background: var(--brand-soft);
  outline: none;
}

.phone-more-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  width: min(620px, calc(100vw - 64px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(27, 35, 48, 0.16);
}

@media (max-width: 680px) {
  .company-facts-compact > .company-phone-fact,
  .company-facts-compact > .company-email-fact,
  .company-facts-compact > .company-site-fact {
    grid-column: 1;
  }

  .company-phone-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .phone-more-popover {
    width: min(360px, calc(100vw - 48px));
  }
}

.phone-more:not([open]) > .phone-more-popover,
.compact-more:not([open]) > .compact-more-lines {
  display: none;
}

/* v1.1: единый редактируемый комментарий компании */
.company-comment-card {
  overflow: hidden;
}

.company-comment-header {
  min-height: 52px;
}

.company-comment-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: var(--radius-chip);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
}

.company-comment-status[data-tone="success"] {
  background: var(--success-bg);
  color: var(--success);
}

.company-comment-status[data-tone="error"] {
  background: var(--danger-bg);
  color: var(--danger);
}

.company-comment-form {
  padding: 12px 16px 16px;
}

.company-comment-display {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: background-color 130ms linear, box-shadow 130ms linear;
}

.company-comment-display:hover {
  background: var(--control);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.company-comment-display:active {
  background: var(--inset);
}

.company-comment-text {
  display: block;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.company-comment-text.is-empty {
  color: var(--ink-3);
}

.company-comment-field {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: 10px;
  resize: vertical;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  outline: 0;
  background: var(--control);
  color: var(--ink);
  line-height: 1.55;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.company-comment-field:focus {
  border-color: rgba(255, 81, 0, 0.24);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--focus);
}

.company-comment-fallback-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.company-comment-form.is-enhanced .company-comment-field,
.company-comment-form.is-enhanced .company-comment-fallback-actions {
  display: none;
}

.company-comment-form.is-enhanced.is-editing .company-comment-display {
  display: none;
}

.company-comment-form.is-enhanced.is-editing .company-comment-field {
  display: block;
}

.company-comment-form.is-saving .company-comment-display {
  cursor: progress;
}

@media (max-width: 680px) {
  .company-comment-form {
    padding-right: 12px;
    padding-left: 12px;
  }
}

/* v1.1: рабочая раскладка карточки компании */
.detail-grid.detail-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.company-inline-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}

.company-inline-control {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 7px 10px;
  padding: 12px 14px;
}

.company-inline-control + .company-inline-control {
  border-left: 1px solid var(--line-soft);
}

.company-inline-control-heading {
  display: flex;
  min-width: 0;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.company-inline-control-heading label {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 680;
}

.company-inline-control select {
  width: 100%;
  min-width: 0;
  height: 36px;
}

.inline-control-submit {
  min-height: 36px;
  white-space: nowrap;
}

.company-inline-control.is-enhanced {
  grid-template-columns: minmax(0, 1fr);
}

.company-inline-control.is-enhanced .inline-control-submit {
  display: none;
}

.company-inline-control.is-saving select {
  cursor: progress;
  opacity: 0.7;
}

.inline-save-status {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: var(--radius-chip);
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 650;
  line-height: 18px;
}

.inline-save-status[data-tone="success"] {
  background: var(--success-bg);
  color: var(--success);
}

.inline-save-status[data-tone="error"] {
  background: var(--danger-bg);
  color: var(--danger);
}

.company-followup-stack {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.next-call-form {
  display: grid;
  grid-template-columns: minmax(170px, 0.72fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 10px 16px 14px;
}

.next-call-form label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 620;
}

.next-call-form input {
  width: 100%;
  min-width: 0;
}

.next-call-form .button {
  min-height: 38px;
  white-space: nowrap;
}

.company-reminders-card .empty-state {
  min-height: 116px;
  padding: 16px;
}

@media (max-width: 680px) {
  .company-inline-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .company-inline-control + .company-inline-control {
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .company-inline-control {
    padding: 10px 12px;
  }

  .next-call-form {
    grid-template-columns: minmax(0, 1fr);
    padding-right: 12px;
    padding-left: 12px;
  }

  .next-call-form .button {
    width: 100%;
  }
}

/* v1.1: страницы и массовые действия списка компаний */
.companies-pager {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  padding: 6px 8px 6px 12px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.per-page-form label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 620;
  white-space: nowrap;
}

.per-page-form select {
  min-width: 72px;
  min-height: 38px;
  padding: 7px 26px 7px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--control);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.per-page-form select:hover {
  border-color: rgba(29, 29, 31, 0.12);
}

.per-page-form select:focus {
  border-color: var(--brand);
  outline: 3px solid var(--focus);
  background: var(--surface);
}

.shown-range {
  color: var(--ink-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.page-numbers {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.page-link,
.page-ellipsis {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: var(--radius-control);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.page-link:hover,
.page-link:focus-visible {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.page-link:focus-visible {
  outline: 3px solid var(--focus);
}

.page-link.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(184, 61, 0, 0.18);
}

.page-link.disabled {
  color: var(--ink-3);
  opacity: 0.45;
}

.page-arrow {
  font-size: 20px;
  font-weight: 500;
}

.page-ellipsis {
  width: 28px;
  flex-basis: 28px;
  color: var(--ink-3);
}

.companies-bulk-form {
  min-width: 0;
}

.bulk-action-bar {
  display: grid;
  min-height: 56px;
  grid-template-columns: auto minmax(190px, 0.9fr) minmax(170px, 0.8fr) auto auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 10px 8px 14px;
  border-radius: var(--radius-card);
  background: var(--brand-soft);
  box-shadow: inset 3px 0 var(--brand), var(--shadow-card);
}

.bulk-action-bar[hidden] {
  display: none;
}

.bulk-action-bar > strong {
  color: var(--brand-strong);
  font-size: 12px;
  white-space: nowrap;
}

.bulk-action-bar select {
  width: 100%;
  min-height: 40px;
  padding: 8px 30px 8px 10px;
  border: 1px solid rgba(184, 61, 0, 0.12);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
}

.bulk-action-bar select:focus {
  border-color: var(--brand);
  outline: 3px solid var(--focus);
}

.bulk-action-bar .button {
  min-height: 40px;
  white-space: nowrap;
}

.bulk-clear {
  background: transparent;
  color: var(--brand-strong);
}

.bulk-clear:hover {
  background: rgba(255, 255, 255, 0.65);
}

.bulk-mobile-select-all {
  display: none;
}

.company-row-select {
  position: relative;
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  cursor: pointer;
}

.company-row-select input,
.bulk-mobile-select-all input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.companies-table .company-select-heading {
  width: 5%;
  text-align: center;
}

.companies-table th:nth-child(2) {
  width: 23%;
}

.companies-table th:nth-child(3) {
  width: 12%;
}

.companies-table th:nth-child(4) {
  width: 9%;
}

.companies-table th:nth-child(5) {
  width: 16%;
}

.companies-table th:nth-child(6) {
  width: 16%;
}

.companies-table th:nth-child(7) {
  width: 19%;
}

.companies-table .company-select-cell {
  padding: 0;
  text-align: center;
}

.companies-table tbody tr.is-selected {
  background: var(--brand-soft);
  box-shadow: inset 3px 0 var(--brand);
}

@media (max-width: 680px) {
  .companies-pager {
    flex-wrap: wrap;
    gap: 7px 10px;
    padding: 9px 10px;
  }

  .per-page-form,
  .shown-range {
    flex: 1 1 auto;
  }

  .shown-range {
    text-align: right;
  }

  .page-numbers {
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .bulk-mobile-select-all {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
    padding: 7px 12px;
    border-radius: var(--radius-control);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 620;
    box-shadow: var(--shadow-card);
  }

  .bulk-action-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }

  .bulk-action-bar > strong,
  .bulk-action-bar > label {
    grid-column: 1 / -1;
  }

  .bulk-action-bar .button {
    width: 100%;
    padding-right: 8px;
    padding-left: 8px;
  }

  .companies-table tbody tr {
    position: relative;
  }

  .companies-table .company-select-cell {
    position: absolute;
    z-index: 2;
    top: 4px;
    right: 6px;
    display: grid;
    width: 40px;
    min-height: 40px;
    padding: 0;
    border: 0;
    place-items: center;
  }

  .companies-table .company-select-cell::before,
  .companies-table .company-cell::before {
    display: none;
  }

  .companies-table .company-cell {
    display: block;
    min-height: 68px;
    padding: 14px 56px 12px 12px;
  }
}

/* v1.1: понятное выполнение и перенос напоминаний */
.reminder-item {
  grid-template-columns: 120px minmax(180px, 1fr) minmax(268px, auto);
}

.reminder-action-zone {
  min-width: 0;
}

.reminder-actions {
  position: relative;
  display: grid;
  min-width: 268px;
  grid-template-columns: repeat(2, minmax(126px, 1fr));
  justify-content: stretch;
  gap: 8px;
}

.reminder-actions[hidden],
.reminder-followup[hidden],
.reminder-followup-options[hidden] {
  display: none;
}

.reminder-action {
  width: 100%;
  min-height: 40px;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.reminder-action:hover,
.reminder-action:focus-visible,
.reminder-move[open] > .reminder-action {
  border-color: rgba(29, 29, 31, 0.16);
  background: var(--control);
  color: var(--ink);
}

.reminder-action:focus-visible,
.reminder-move-menu button:focus-visible,
.reminder-custom-date summary:focus-visible,
.reminder-followup-options button:focus-visible,
.followup-custom-date summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.reminder-action:active {
  transform: scale(0.97);
}

.reminder-move {
  position: relative;
  min-width: 0;
}

.reminder-move > summary {
  display: flex;
  list-style: none;
  cursor: pointer;
}

.reminder-move > summary::-webkit-details-marker,
.reminder-custom-date > summary::-webkit-details-marker,
.followup-custom-date > summary::-webkit-details-marker {
  display: none;
}

.reminder-move > summary span {
  margin-left: 6px;
  color: var(--ink-3);
  font-size: 10px;
}

.reminder-move-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 272px;
  gap: 2px;
  padding: 8px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(29, 29, 31, 0.08), 0 10px 28px rgba(29, 29, 31, 0.12);
}

.reminder-move-menu > small {
  padding: 4px 8px 7px;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.35;
}

.reminder-move-menu > button,
.reminder-custom-date > summary {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  padding: 8px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.reminder-move-menu > button:hover,
.reminder-custom-date > summary:hover,
.reminder-custom-date[open] > summary {
  background: var(--control);
}

.reminder-custom-date > div,
.followup-custom-date > div {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-control);
  background: var(--inset);
}

.reminder-custom-date label,
.followup-custom-date label {
  display: grid;
  gap: 4px;
  color: var(--ink-2);
  font-size: 11px;
}

.reminder-custom-date input,
.followup-custom-date input {
  width: 100%;
}

.reminder-action-status,
.reminder-followup-status {
  grid-column: 1 / -1;
  color: var(--ink-3);
  font-size: 11px;
}

.reminder-action-status[data-tone="error"],
.reminder-followup-status[data-tone="error"] {
  color: var(--danger);
}

.reminder-followup {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: var(--success-bg);
}

.reminder-followup-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-size: 12px;
}

.reminder-followup-state > span {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  font-size: 11px;
}

.reminder-followup form {
  display: flex;
  min-width: 0;
  flex: 1 1 420px;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.reminder-followup-label {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.reminder-followup-options {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: var(--ink-3);
}

.reminder-followup-options > button,
.followup-custom-date > summary {
  min-height: 36px;
  padding: 6px 7px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.reminder-followup-options > button:hover,
.followup-custom-date > summary:hover,
.followup-custom-date[open] > summary {
  background: rgba(255, 255, 255, 0.7);
}

.followup-custom-date {
  position: relative;
}

.followup-custom-date > div {
  position: absolute;
  z-index: 21;
  top: calc(100% + 6px);
  left: 0;
  width: 250px;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(29, 29, 31, 0.08), 0 10px 28px rgba(29, 29, 31, 0.12);
}

.reminder-followup.is-finished {
  background: var(--control);
}

.reminder-followup.is-finished .reminder-followup-label {
  color: var(--ink);
  font-size: 12px;
}

.completed-reminder-card {
  margin: 10px 0;
  padding: 10px;
}

.company-reminder-item > .reminder-action-zone {
  justify-self: start;
}

.company-reminders-card > .reminder-followup {
  margin: 8px 0 10px;
}

@media (max-width: 1180px) {
  .reminder-item > .reminder-action-zone {
    grid-column: 2;
  }
}

@media (max-width: 680px) {
  .reminder-item > .reminder-action-zone {
    grid-column: 1;
  }

  .reminder-actions {
    width: 100%;
    min-width: 0;
  }

  .reminder-move-menu {
    right: 0;
    width: min(272px, calc(100vw - 44px));
  }

  .reminder-followup {
    align-items: flex-start;
    flex-direction: column;
  }

  .reminder-followup form {
    width: 100%;
    flex-basis: auto;
    align-items: flex-start;
    flex-direction: column;
  }

  .reminder-followup-options {
    width: 100%;
  }

  .followup-custom-date > div {
    right: 0;
    left: auto;
    width: min(250px, calc(100vw - 56px));
  }
}

.reminder-panel {
  overflow: visible;
}

.reminder-item:has(.reminder-move[open]) {
  z-index: 2;
}

/* v1.1: компактный выбор и навигация списка компаний */
.companies-pager {
  min-height: 32px;
  justify-content: flex-end;
  gap: 8px;
  margin: 4px 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.per-page-form label,
.shown-range {
  font-size: 10px;
}

.per-page-form select {
  min-width: 54px;
  min-height: 28px;
  padding: 4px 20px 4px 7px;
  font-size: 11px;
}

.page-numbers {
  margin-left: 0;
}

.page-link,
.page-ellipsis {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 7px;
  font-size: 11px;
}

.page-arrow {
  font-size: 16px;
}

.page-ellipsis {
  width: 20px;
  flex-basis: 20px;
}

.bulk-action-bar {
  position: sticky;
  z-index: 7;
  top: 64px;
  display: flex;
  height: 44px;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 4px 8px 4px 12px;
  border-radius: 8px;
  background: var(--brand-soft);
  box-shadow: inset 3px 0 var(--brand), 0 2px 8px rgba(29, 29, 31, 0.08);
}

.bulk-action-bar[hidden] {
  display: none;
}

.bulk-action-bar > strong {
  flex: 0 0 auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.bulk-separator {
  flex: 0 0 auto;
  color: var(--ink-3);
}

.bulk-action-bar > label {
  flex: 0 1 190px;
  min-width: 132px;
}

.bulk-action-bar select {
  min-height: 34px;
  padding: 5px 26px 5px 8px;
  font-size: 11px;
}

.bulk-action-bar .button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 11px;
}

.company-row-select {
  width: 36px;
  height: 36px;
}

.company-row-select input,
.bulk-mobile-select-all input {
  width: 16px;
  height: 16px;
}

.companies-table .company-select-heading,
.companies-table .company-select-cell {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  padding: 0;
}

@media (max-width: 680px) {
  .companies-pager {
    min-height: 32px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 5px;
    padding: 0;
    overflow: visible;
  }

  .companies-pager .page-link:not(.page-arrow):not(.active),
  .companies-pager .page-ellipsis {
    display: none;
  }

  .per-page-form,
  .shown-range {
    flex: 0 0 auto;
  }

  .shown-range {
    text-align: left;
  }

  .page-numbers {
    width: auto;
    flex: 0 0 auto;
    overflow: visible;
  }

  .bulk-mobile-select-all {
    display: flex;
    width: max-content;
    min-height: 32px;
    align-items: center;
    gap: 6px;
    margin: 0 0 4px auto;
    padding: 0 4px;
    border-radius: 0;
    background: transparent;
    font-size: 10px;
    box-shadow: none;
  }

  .bulk-action-bar {
    position: fixed;
    z-index: 30;
    right: 8px;
    bottom: 8px;
    left: 8px;
    top: auto;
    display: grid;
    width: auto;
    height: auto;
    min-height: 0;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 4px;
    margin: 0;
    padding: 6px 7px 6px 10px;
    border-radius: 10px;
    box-shadow: inset 3px 0 var(--brand), 0 8px 28px rgba(29, 29, 31, 0.2);
  }

  .bulk-action-bar > strong {
    grid-column: 1;
  }

  .bulk-action-bar > label {
    min-width: 0;
    grid-column: auto;
  }

  .bulk-action-bar > .bulk-separator:first-of-type {
    display: none;
  }

  .bulk-action-bar > .bulk-separator:last-of-type {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }

  .bulk-action-bar select {
    min-height: 32px;
    padding-right: 20px;
    padding-left: 6px;
    font-size: 10px;
  }

  .bulk-action-bar .button {
    width: auto;
    min-height: 32px;
    padding: 5px 7px;
    font-size: 10px;
  }

  .bulk-clear {
    grid-column: 3 / 5;
    grid-row: 2;
    justify-self: end;
  }

  body:has(.bulk-action-bar:not([hidden])) .page-content {
    padding-bottom: 92px;
  }

  .companies-table .company-select-cell {
    top: 4px;
    right: 4px;
    width: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .companies-table .company-cell {
    padding-right: 48px;
  }
}

.companies-table .company-select-column {
  width: 36px;
}

@media (min-width: 681px) {
  .companies-table th:nth-child(2) {
    width: 24.21%;
  }

  .companies-table th:nth-child(3) {
    width: 12.63%;
  }

  .companies-table th:nth-child(4) {
    width: 9.47%;
  }

  .companies-table th:nth-child(5),
  .companies-table th:nth-child(6) {
    width: 16.84%;
  }

  .companies-table th:nth-child(7) {
    width: 20.01%;
  }
}

@media (max-width: 680px) {
  .bulk-action-bar > .bulk-separator {
    display: none;
  }
}

/* v1.1: нейтральный триггер меню переноса напоминания */
.reminder-move[open] > .reminder-action,
.reminder-move[open] > .reminder-action:hover {
  border-color: var(--line);
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

.reminder-move[open] > .reminder-action:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.company-reminders-card {
  overflow: visible;
}

.company-reminder-item:has(.reminder-move[open]) {
  position: relative;
  z-index: 2;
}

.reminder-move:not([open]) > .reminder-move-menu {
  display: none;
}

/* v1.1: единая система полей CRM */
:root {
  --field-height: 40px;
  --field-fill: var(--surface);
  --field-border: rgba(29, 29, 31, 0.14);
  --field-border-hover: rgba(29, 29, 31, 0.24);
  --field-radius: 9px;
}

:is(
  input[type="text"],
  input[type="search"],
  input[type="password"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="number"],
  select
) {
  height: var(--field-height);
  min-height: var(--field-height);
  padding: 0 12px;
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  background-color: var(--field-fill);
  color: var(--ink);
  box-shadow: 0 1px 1px rgba(29, 29, 31, 0.025);
  font: inherit;
  line-height: 1.2;
  transition: border-color 130ms linear, background-color 130ms linear,
    box-shadow 130ms linear;
}

textarea {
  width: 100%;
  max-width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  background-color: var(--field-fill);
  color: var(--ink);
  box-shadow: 0 1px 1px rgba(29, 29, 31, 0.025);
  font: inherit;
  line-height: 1.45;
  transition: border-color 130ms linear, background-color 130ms linear,
    box-shadow 130ms linear;
}

:is(
  input[type="text"],
  input[type="search"],
  input[type="password"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="number"],
  select,
  textarea
):hover:not(:disabled) {
  border-color: var(--field-border-hover);
}

:is(
  input[type="text"],
  input[type="search"],
  input[type="password"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="number"],
  select,
  textarea
):focus {
  border-color: var(--field-border);
  outline: 0;
  background-color: var(--field-fill);
  box-shadow: 0 1px 1px rgba(29, 29, 31, 0.025);
}

:is(
  input[type="text"],
  input[type="search"],
  input[type="password"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="number"],
  select,
  textarea
):focus-visible {
  border-color: rgba(255, 81, 0, 0.48);
  outline: 0;
  box-shadow: 0 0 0 3px var(--focus);
}

:is(
  input[type="text"],
  input[type="search"],
  input[type="password"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="number"],
  textarea
)::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

select:not([multiple]):not([size]) {
  padding-right: 38px;
  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 14 14'%3E%3Cpath d='m4 5.5 3 3 3-3' fill='none' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
}

input:is([type="date"], [type="datetime-local"]) {
  width: max-content;
  min-width: 220px;
  max-width: 100%;
  padding-right: 10px;
  font-variant-numeric: tabular-nums;
}

input:is([type="date"], [type="datetime-local"])::-webkit-calendar-picker-indicator {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 7px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.62;
}

input:is([type="date"], [type="datetime-local"])::-webkit-calendar-picker-indicator:hover {
  background-color: var(--control);
  opacity: 0.9;
}

.datetime-control {
  position: relative;
  display: inline-grid;
  width: max-content;
  max-width: 100%;
}

.datetime-control > input {
  width: 220px;
}

.datetime-readable {
  display: none;
}

.js .datetime-control:not(:focus-within) .datetime-readable {
  position: absolute;
  z-index: 1;
  top: 1px;
  right: 40px;
  bottom: 1px;
  left: 12px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--field-fill);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.js .datetime-control:not(:focus-within) .datetime-readable.is-empty {
  color: var(--ink-3);
}

.js .datetime-control:not(:focus-within) > input {
  color: transparent;
  caret-color: transparent;
}

.global-search input {
  padding-right: 74px;
  padding-left: 38px;
}

.search-field input {
  padding-left: 38px;
}

.toolbar .button,
.next-call-form .button,
.company-inline-control .button,
.bulk-action-bar .button {
  height: var(--field-height);
  min-height: var(--field-height);
}

@media (max-width: 680px) {
  .datetime-control,
  .datetime-control > input {
    width: 100%;
    min-width: 0;
  }
}

/* v1.1: правка реквизитов и контактов прямо в поле */
.inline-edit,
.inline-collection,
.inline-lpr {
  position: relative;
  min-width: 0;
}

.inline-edit-display,
.inline-item-display {
  min-width: 0;
  padding: 2px 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms linear, color 120ms linear;
}

.inline-edit-display:hover,
.inline-item-display:hover {
  background: var(--control);
}

.inline-edit-display:focus {
  outline: 0;
}

.inline-edit-display:focus-visible,
.inline-item-display:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.inline-edit-display.is-empty,
.inline-item-display.is-empty {
  color: var(--ink-3);
  font-weight: 500;
}

.inline-site-link {
  display: inline-grid;
  width: 24px;
  height: 24px;
  min-height: 24px;
  place-items: center;
  margin-left: 2px;
  border-radius: 6px;
  background: var(--control);
  color: var(--brand-strong);
  font-size: 12px;
  text-decoration: none;
  vertical-align: middle;
}

.inline-site-link:hover {
  background: var(--brand-soft);
}

.inline-edit.is-enhanced:not(.is-editing) > [data-inline-input],
.inline-collection.is-enhanced .inline-collection-row:not(.is-editing) > [data-inline-item-input],
.is-enhanced > .inline-edit-fallback {
  display: none;
}

.inline-edit.is-enhanced.is-editing > .inline-edit-display,
.inline-collection.is-enhanced .inline-collection-row.is-editing > [data-inline-item-display] {
  display: none;
}

.inline-edit > [data-inline-input] {
  width: min(100%, 440px);
}

.inline-edit.has-error > [data-inline-input],
.inline-collection-row.has-error > [data-inline-item-input] {
  border-color: #c53a2e;
  box-shadow: 0 0 0 3px rgba(197, 58, 46, 0.12);
}

.inline-edit-status {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  margin-left: 5px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
}

.inline-edit-status[data-tone="success"] {
  color: #18724b;
}

.inline-edit-status[data-tone="error"],
.inline-edit-error,
.inline-item-error {
  color: #b42318;
}

.inline-edit-error,
.inline-item-error {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
}

.company-page-header .page-title {
  width: min(100%, 820px);
}

.company-name-editor .inline-edit-display {
  max-width: 760px;
  padding: 1px 5px;
  font-size: 25px;
  font-weight: 760;
  line-height: 1.18;
  letter-spacing: -0.028em;
  overflow-wrap: anywhere;
}

.company-name-editor > [data-inline-input] {
  width: min(100%, 760px);
  height: 42px;
  font-size: 22px;
  font-weight: 700;
}

.company-sphere-editor {
  margin-top: 2px;
}

.company-sphere-editor .inline-edit-display {
  max-width: 760px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}

.company-facts dd > .inline-edit .inline-edit-display {
  max-width: 100%;
}

.company-facts dd > .inline-edit > [data-inline-input] {
  width: 100%;
  height: 34px;
  min-height: 34px;
  font-size: 12px;
}

.inline-collection-grid {
  display: grid;
  align-items: start;
  gap: 2px 12px;
}

.inline-email-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

.inline-collection .inline-collection-row {
  position: relative;
  height: 30px;
  min-height: 30px;
  padding-right: 2px;
}

.inline-collection[data-inline-field="phones"] .inline-collection-row {
  grid-template-columns: 24px minmax(130px, max-content) minmax(0, 1fr) 24px;
}

.inline-collection[data-inline-field="emails"] .inline-collection-row {
  grid-template-columns: 22px minmax(0, 1fr) 24px;
}

.inline-collection .inline-item-display {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-collection[data-inline-field="emails"] .inline-item-display {
  color: var(--brand-strong);
  font-size: 11px;
}

.inline-collection .phone-call,
.inline-email-link {
  display: inline-grid;
  width: 22px;
  height: 22px;
  min-height: 22px;
  place-items: center;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
}

.inline-collection .phone-call {
  width: 24px;
  height: 24px;
  min-height: 24px;
}

.inline-email-link {
  background: var(--control);
  color: var(--brand-strong);
  text-decoration: none;
}

.inline-email-link:hover {
  background: var(--brand-soft);
}

.inline-collection-row > [data-inline-item-input] {
  height: 30px;
  min-height: 30px;
  min-width: 0;
  padding: 0 8px;
  font-size: 11px;
}

.inline-collection[data-inline-field="phones"] .inline-collection-row.is-editing > [data-inline-item-input] {
  grid-column: 2 / 4;
}

.inline-collection[data-inline-field="emails"] .inline-collection-row.is-editing > [data-inline-item-input] {
  grid-column: 2;
}

.inline-item-delete {
  display: inline-grid;
  width: 24px;
  height: 24px;
  min-height: 24px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  font-size: 17px;
  line-height: 1;
  opacity: 0;
  cursor: pointer;
}

.inline-collection-row:hover .inline-item-delete,
.inline-item-delete:focus-visible {
  opacity: 1;
}

.inline-item-delete:hover {
  background: #fff0ee;
  color: #b42318;
}

.inline-collection-add,
.inline-contact-add {
  min-height: 28px;
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.inline-collection-add:hover,
.inline-contact-add:hover {
  background: var(--brand-soft);
}

.inline-collection-more {
  z-index: 4;
}

.inline-contact-row {
  grid-template-columns: 30px minmax(150px, 1fr) minmax(180px, 1.2fr) minmax(170px, 1fr) auto;
  align-items: start;
  overflow: visible;
}

.inline-contact-row .contact-main {
  display: grid;
  gap: 1px;
}

.inline-contact-row .contact-name-editor .inline-edit-display {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.inline-contact-row .contact-position-editor .inline-edit-display {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 500;
}

.inline-contact-row .inline-edit > [data-inline-input] {
  width: 100%;
  height: 32px;
  min-height: 32px;
  font-size: 11px;
}

.inline-contact-row .company-phone-grid {
  grid-template-columns: minmax(0, 1fr);
}

.inline-contact-row .inline-collection[data-inline-field="phones"] .inline-collection-row {
  grid-template-columns: 24px minmax(112px, 1fr) 24px;
}

.inline-contact-row .inline-collection[data-inline-field="phones"] .inline-collection-row > small {
  display: none;
}

.inline-contact-row .inline-collection[data-inline-field="phones"] .inline-collection-row.is-editing > [data-inline-item-input] {
  grid-column: 2;
}

.inline-lpr label {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.inline-lpr input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.inline-contact-add {
  margin: 0 16px 14px;
}

.inline-contact-row[data-contact-draft] {
  outline: 1px dashed var(--line);
  background: var(--surface);
}

@media (max-width: 920px) {
  .inline-contact-row {
    grid-template-columns: 30px minmax(140px, 1fr) minmax(160px, 1fr) auto;
  }

  .inline-contact-row .contact-emails {
    grid-column: 2 / 4;
  }
}

@media (max-width: 680px) {
  .company-name-editor .inline-edit-display {
    font-size: 22px;
  }

  .inline-item-delete {
    opacity: 0.7;
  }

  .inline-contact-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 7px;
  }

  .inline-contact-row .contact-main {
    grid-column: 2;
  }

  .inline-contact-row .contact-phones,
  .inline-contact-row .contact-emails {
    grid-column: 2 / -1;
  }

  .inline-contact-row .inline-lpr {
    grid-column: 3;
    grid-row: 1;
  }

  .inline-collection[data-inline-field="phones"] .inline-collection-row {
    grid-template-columns: 24px minmax(120px, 1fr) minmax(0, auto) 24px;
  }
}

/* v1.1 №45: редакторы в поле сохраняют единую высоту контролов 40 px */
.inline-edit.is-enhanced.is-editing > [data-inline-input],
.company-facts dd > .inline-edit.is-enhanced.is-editing > [data-inline-input],
.inline-contact-row .inline-edit.is-enhanced.is-editing > [data-inline-input],
.inline-collection.is-enhanced .inline-collection-row.is-editing > [data-inline-item-input],
.inline-contact-row .inline-collection[data-inline-field="phones"] .inline-collection-row.is-editing > [data-inline-item-input] {
  height: var(--field-height);
  min-height: var(--field-height);
  box-sizing: border-box;
}

.inline-collection.is-enhanced .inline-collection-row.is-editing {
  height: var(--field-height);
  min-height: var(--field-height);
}

