.call-settings {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.call-settings .call-hidden {
  display: none;
}

.cs-card {
  padding: 32px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  box-shadow: var(--c-shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.cs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cs-head-text {
  min-width: 0;
}

.cs-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--c-text);
}

.cs-desc {
  margin: 5px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--c-text-2);
}

.cs-head-action {
  flex-shrink: 0;
}

.cs-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.cs-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px 20px;
}

.cs-grid > .cs-field {
  grid-column: span 2;
}

.cs-grid > .cs-field:nth-child(n + 4) {
  grid-column: span 3;
}

.cs-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}

.cs-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}

.cs-field label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--c-text);
}

.cs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 12px 0;
}

.cs-body > .cs-row {
  margin-block: -4px;
}

.cs-row + .cs-row {
  border-top: 1px solid var(--c-border);
}

.cs-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 280px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}

.cs-row-text label {
  margin: 0;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
}

.cs-hint {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--c-text-muted);
}

.cs-row-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-row-wide .cs-row-control {
  flex: 1 1 100%;
}

.cs-row-wide .call-tpl-lang {
  flex: 1 1 auto;
  min-width: 0;
}

.cs-card .call-select-trigger {
  height: 42px;
  min-width: 260px;
  padding: 0 14px;
  border: 1px solid var(--c-border-strong);
  border-radius: 12px;
  background: var(--c-surface-muted);
  box-shadow: none;
  font-size: 14.5px;
  font-weight: 400;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.cs-card .call-select-trigger:hover:not(:disabled):not([aria-expanded="true"]) {
  background: var(--c-surface);
  border-color: var(--c-text-muted);
}

.cs-card .call-select-trigger:focus-visible,
.cs-card .call-select-trigger[aria-expanded="true"] {
  outline: none;
  background: var(--c-surface);
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(226, 68, 14, 0.18);
}

.cs-unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-muted);
}

.cs-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--c-border-strong);
  border-radius: 12px;
  background: var(--c-surface-muted);
  box-shadow: none;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--c-text);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.cs-input:hover:not(:focus) {
  background: var(--c-surface);
  border-color: var(--c-text-muted);
}

.cs-input:focus {
  outline: none;
  background: var(--c-surface);
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(226, 68, 14, 0.18);
}

.cs-input.narrow {
  width: 96px;
  text-align: right;
}

.cs-input.medium {
  width: 260px;
  max-width: 100%;
}

select.cs-input {
  padding-right: 34px;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--c-text-muted) 50%) calc(100% - 17px) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--c-text-muted) 50%, transparent 50%) calc(100% - 12px) 50% / 5px 5px no-repeat,
    var(--c-surface-muted);
  cursor: pointer;
}

textarea.cs-input {
  height: auto;
  min-height: 88px;
  padding: 10px 14px;
  line-height: 1.5;
  resize: vertical;
}

.cs-stack {
  align-items: stretch;
}

.cs-field > .cs-link {
  align-self: flex-end;
}

.cs-link {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--c-text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

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

.cs-link.danger:hover {
  color: var(--c-danger);
}

.cs-sum {
  margin: 4px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--c-border);
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

.cs-sum:empty {
  display: none;
}

.cs-sum.invalid {
  color: var(--c-danger);
}

.cs-footer {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 14px;
}

.cs-footer .call-btn {
  height: 42px;
  padding: 0 24px;
  font-size: 14.5px;
}

.cs-dirty {
  font-size: 12.5px;
  color: var(--c-text-muted);
}

.call-btn.solid {
  background: #16272d;
  border-color: transparent;
  color: #fff;
  box-shadow: 0 1px 2px rgba(15, 31, 36, 0.16), 0 4px 12px rgba(15, 31, 36, 0.14);
}

.call-btn.solid:hover:not(:disabled) {
  background: #0f1f24;
  border-color: transparent;
}

.call-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.call-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

@media (max-width: 900px) {
  .cs-grid,
  .cs-pair {
    grid-template-columns: minmax(0, 1fr);
  }
  .cs-grid > .cs-field,
  .cs-grid > .cs-field:nth-child(n + 4) {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .cs-card {
    padding: 22px;
  }
}

.call-tpl-lang summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-2);
}

.call-tpl-grid {
  display: grid;
  grid-template-columns: max-content repeat(4, minmax(110px, 1fr));
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--c-text-muted);
}

.call-tpl-kind {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
}

.call-tpl-grid .cs-input {
  min-width: 0;
}

@media (max-width: 900px) {
  .call-tpl-grid {
    grid-template-columns: max-content repeat(2, minmax(110px, 1fr));
  }
}
