#tsc-section-manager-root,
#tsc-section-manager-root * {
  box-sizing: border-box;
}

.tsc-section-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  color: #fff;
  background: #0f2744;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .24);
  font: 750 14px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
  cursor: pointer;
}

.tsc-section-launcher:hover {
  background: #173b66;
}

.tsc-section-launcher[hidden],
.tsc-section-overlay[hidden] {
  display: none;
}

.tsc-section-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: rgba(15, 23, 42, .72);
}

.tsc-section-dialog {
  width: min(820px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 20px;
  background: #f8fafc;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .34);
  color: #0f172a;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.tsc-section-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, .98);
}

.tsc-section-header h1 {
  margin: 0;
  color: #0f2744;
  font-size: 21px;
  font-weight: 850;
}

.tsc-section-header p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.tsc-section-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.tsc-section-safety {
  margin-left: auto;
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
}

.tsc-section-list {
  display: grid;
  gap: 10px;
  padding: 18px 22px;
  background: #fff;
}

.tsc-section-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dbe3ec;
  border-radius: 13px;
  background: #f8fafc;
}

.tsc-section-position {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #e8eef6;
  color: #0f2744;
  font-size: 13px;
  font-weight: 850;
}

.tsc-section-name {
  display: grid;
  gap: 5px;
}

.tsc-section-name span {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.tsc-section-name input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 9px 11px;
  background: #fff;
  color: #0f172a;
  font: 650 14px/1.25 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.tsc-section-name input:focus {
  border-color: #2563eb;
  outline: 3px solid rgba(37, 99, 235, .16);
}

.tsc-section-move {
  display: flex;
  gap: 7px;
}

.tsc-section-button,
.tsc-section-icon-button {
  min-height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font: 750 13px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
  cursor: pointer;
}

.tsc-section-button {
  padding: 9px 13px;
}

.tsc-section-icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  padding: 0;
  font-size: 19px;
}

.tsc-section-button:hover:not(:disabled),
.tsc-section-icon-button:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.tsc-section-button:disabled,
.tsc-section-icon-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.tsc-section-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-top: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, .98);
}

.tsc-section-actions {
  display: flex;
  flex-shrink: 0;
  gap: 9px;
}

.tsc-section-save {
  border-color: #d62828;
  background: #d62828;
  color: #fff;
}

.tsc-section-save:hover:not(:disabled) {
  border-color: #b91c1c;
  background: #b91c1c;
}

.tsc-section-status {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.tsc-section-status-success {
  color: #047857;
  font-weight: 750;
}

.tsc-section-status-warning {
  color: #b45309;
  font-weight: 700;
}

.tsc-section-status-error {
  color: #b91c1c;
  font-weight: 750;
}

.tsc-section-message {
  padding: 30px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
  text-align: center;
}

.tsc-section-message-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

@media (max-width: 680px) {
  .tsc-section-overlay {
    padding: 0;
    place-items: stretch;
  }

  .tsc-section-dialog {
    max-height: 100vh;
    border-radius: 0;
  }

  .tsc-section-toolbar,
  .tsc-section-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .tsc-section-safety {
    margin-left: 0;
  }

  .tsc-section-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .tsc-section-position {
    width: 32px;
    height: 32px;
  }

  .tsc-section-move {
    grid-column: 2;
    justify-content: flex-end;
  }

  .tsc-section-actions {
    width: 100%;
  }

  .tsc-section-actions .tsc-section-button {
    flex: 1;
  }

  .tsc-section-launcher {
    right: 14px;
    bottom: 14px;
  }
}
